diff --git a/ansible/roles/cinder/handlers/main.yml b/ansible/roles/cinder/handlers/main.yml index 7c5c593c8a..485669848e 100644 --- a/ansible/roles/cinder/handlers/main.yml +++ b/ansible/roles/cinder/handlers/main.yml @@ -19,11 +19,9 @@ - service.enabled | bool - config_json.changed | bool or cinder_conf.changed | bool + or wsgi_cinder_api.changed | bool or policy_json.changed | bool or cinder_api_container.changed | bool - or (kolla_base_distro in ['debian', 'ubuntu'] - and kolla_install_type == 'binary' - and wsgi_cinder_api | changed) - name: Restart cinder-scheduler container vars: diff --git a/ansible/roles/cinder/tasks/config.yml b/ansible/roles/cinder/tasks/config.yml index 3f808ddde0..9bdc5f2654 100644 --- a/ansible/roles/cinder/tasks/config.yml +++ b/ansible/roles/cinder/tasks/config.yml @@ -38,8 +38,6 @@ when: - inventory_hostname in groups[service.group] - service.enabled | bool - - kolla_base_distro in ['debian', 'ubuntu'] - - kolla_install_type == 'binary' notify: - Restart cinder-api container diff --git a/ansible/roles/cinder/templates/cinder-api.json.j2 b/ansible/roles/cinder/templates/cinder-api.json.j2 index 9a38426f41..4b5243fffc 100644 --- a/ansible/roles/cinder/templates/cinder-api.json.j2 +++ b/ansible/roles/cinder/templates/cinder-api.json.j2 @@ -1,6 +1,7 @@ -{% set command = '/usr/sbin/apache2 -DFOREGROUND' if kolla_base_distro in ['ubuntu', 'debian'] and kolla_install_type == 'binary' else 'cinder-api --config-file /etc/cinder/cinder.conf' %} +{% set cinder_cmd = 'apache2' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd' %} +{% set cinder_dir = 'apache2/conf-enabled' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd/conf.d' %} { - "command": "{{ command }}", + "command": "{{ cinder_cmd }} -DFOREGROUND", "config_files": [ { "source": "{{ container_config_directory }}/cinder.conf", @@ -8,19 +9,19 @@ "owner": "cinder", "perm": "0600" }, + { + "source": "{{ container_config_directory }}/cinder-wsgi.conf", + "dest": "/etc/{{ cinder_dir }}/cinder-wsgi.conf", + "owner": "cinder", + "perm": "0600" + }, { "source": "{{ container_config_directory }}/policy.json", "dest": "/etc/cinder/policy.json", "owner": "cinder", "perm": "0600", "optional": true - }{% if kolla_base_distro in ['ubuntu', 'debian'] and kolla_install_type == 'binary' %}, - { - "source": "{{ container_config_directory }}/cinder-wsgi.conf", - "dest": "/etc/apache2/conf-enabled/cinder-wsgi.conf", - "owner": "cinder", - "perm": "0600" - }{% endif %} + } ], "permissions": [ { diff --git a/releasenotes/notes/cinder-api-apache-fc58978df0645b2f.yaml b/releasenotes/notes/cinder-api-apache-fc58978df0645b2f.yaml new file mode 100644 index 0000000000..867d31e276 --- /dev/null +++ b/releasenotes/notes/cinder-api-apache-fc58978df0645b2f.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Cinder-api service has been migrated to run under + an apache wsgi process.