TLS support for Cinder services

Depends-On: If796ea145c0a6b1bcb711496a4ad97a0a4ac2fb2
Change-Id: Ie24abf9767db88361eb247c4363e7dedfe30d934
This commit is contained in:
Anastasiya 2017-02-03 12:54:57 +04:00
parent c7518fc787
commit 8542507a71
7 changed files with 58 additions and 1 deletions

View File

@ -98,13 +98,48 @@ service:
daemon:
command: cinder-api --config-file /etc/cinder/cinder.conf
files:
# {% if security.tls.openstack.enabled %}
- ca_cert
# {% endif %}
- cinder-conf
dependencies:
- memcached
- "{{ messaging.dependencies[messaging.backend.rpc] }}"
- "{{ messaging.dependencies[messaging.backend.notifications] }}"
# {% if security.tls.openstack.enabled %}
- name: nginx
image: nginx
daemon:
files:
- upstreams
- servers
- server-cert
- server-key
command: nginx
# {% endif %}
files:
cinder-conf:
path: /etc/cinder/cinder.conf
content: cinder.conf.j2
# {% if security.tls.openstack.enabled %}
servers:
path: /etc/nginx/conf.d/servers.conf
content: nginx-api.conf.j2
perm: "0400"
ca_cert:
path: /opt/ccp/etc/tls/ca.pem
content: ca-cert.pem.j2
upstreams:
path: /etc/nginx/conf.d/upstreams.conf
content: upstreams.conf.j2
perm: "0400"
server-cert:
path: /opt/ccp/etc/tls/server-cert.pem
content: server-cert.pem.j2
perm: "0400"
server-key:
path: /opt/ccp/etc/tls/server-key.pem
content: server-key.pem.j2
perm: "0400"
# {% endif %}

View File

@ -0,0 +1 @@
{{ security.tls.ca_cert }}

View File

@ -14,7 +14,11 @@ os_region_name = RegionOne
enabled_backends = {{ cinder.enabled_backends }}
{% if security.tls.openstack.enabled %}
osapi_volume_listen = 127.0.0.1
{% else %}
osapi_volume_listen = {{ network_topology["private"]["address"] }}
{% endif %}
osapi_volume_listen_port = {{ cinder.api_port.cont }}
api_paste_config = /etc/cinder/api-paste.ini
@ -31,6 +35,9 @@ max_retries = -1
auth_version = v3
auth_uri = {{ address('keystone', keystone.public_port, with_scheme=True) }}/v3
auth_url = {{ address('keystone', keystone.admin_port, with_scheme=True) }}/v3
{% if security.tls.openstack.enabled %}
cafile = /opt/ccp/etc/tls/ca.pem
{% endif %}
auth_type = password
project_domain_id = default
user_domain_id = default
@ -61,4 +68,4 @@ driver = {{ searchlight.notification_driver }}
{# messaging macros template #}
{{ oslo_messaging[messaging.backend.rpc]('rpc_config') }}
{{ oslo_messaging[messaging.backend.notifications]('notifications_config') }}
{{ oslo_messaging[messaging.backend.notifications]('notifications_config') }}

View File

@ -0,0 +1,9 @@
server {
listen {{ cinder.api_port.cont }};
include common/ssl.conf;
location / {
proxy_pass http://cinder_api;
include common/proxy-headers.conf;
}
}

View File

@ -0,0 +1 @@
{{ security.tls.server_cert }}

View File

@ -0,0 +1 @@
{{ security.tls.server_key }}

View File

@ -0,0 +1,3 @@
upstream cinder_api {
server 127.0.0.1:{{ cinder.api_port.cont }};
}