2015-08-04 07:39:22 +00:00
|
|
|
---
|
2015-12-18 19:40:48 +00:00
|
|
|
- name: Ensuring config directories exist
|
|
|
|
file:
|
2017-01-19 12:42:27 +08:00
|
|
|
path: "{{ node_config_directory }}/{{ item.key }}"
|
2015-12-18 19:40:48 +00:00
|
|
|
state: "directory"
|
2016-08-24 00:28:08 +07:00
|
|
|
owner: "{{ config_owner_user }}"
|
|
|
|
group: "{{ config_owner_group }}"
|
|
|
|
mode: "0770"
|
|
|
|
become: true
|
2017-01-19 12:42:27 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
|
|
|
with_dict: "{{ cinder_services }}"
|
2015-08-04 07:39:22 +00:00
|
|
|
|
2018-09-25 12:37:26 +01:00
|
|
|
- include_tasks: external_ceph.yml
|
|
|
|
when:
|
2020-01-27 12:28:59 +01:00
|
|
|
- cinder_backend_ceph | bool
|
2018-09-25 12:37:26 +01:00
|
|
|
- inventory_hostname in groups['cinder-volume'] or
|
|
|
|
inventory_hostname in groups['cinder-backup']
|
|
|
|
|
2018-01-08 11:21:12 +07:00
|
|
|
- name: Check if policies shall be overwritten
|
2019-11-19 09:34:23 +00:00
|
|
|
stat:
|
|
|
|
path: "{{ item }}"
|
|
|
|
delegate_to: localhost
|
2018-01-08 11:21:12 +07:00
|
|
|
run_once: True
|
|
|
|
register: cinder_policy
|
|
|
|
with_first_found:
|
|
|
|
- files: "{{ supported_policy_format_list }}"
|
|
|
|
paths:
|
|
|
|
- "{{ node_custom_config }}/cinder/"
|
|
|
|
skip: true
|
|
|
|
|
|
|
|
- name: Set cinder policy file
|
|
|
|
set_fact:
|
|
|
|
cinder_policy_file: "{{ cinder_policy.results.0.stat.path | basename }}"
|
|
|
|
cinder_policy_file_path: "{{ cinder_policy.results.0.stat.path }}"
|
|
|
|
when:
|
|
|
|
- cinder_policy.results
|
|
|
|
|
2020-04-10 13:53:19 -07:00
|
|
|
- include_tasks: copy-certs.yml
|
2019-12-18 15:49:28 -08:00
|
|
|
when:
|
2021-03-23 15:59:52 +00:00
|
|
|
- kolla_copy_ca_into_containers | bool or cinder_enable_tls_backend | bool
|
2019-12-18 15:49:28 -08:00
|
|
|
|
2015-12-18 19:40:48 +00:00
|
|
|
- name: Copying over config.json files for services
|
2015-09-17 14:58:02 -04:00
|
|
|
template:
|
2017-01-19 12:42:27 +08:00
|
|
|
src: "{{ item.key }}.json.j2"
|
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
|
2016-08-24 00:28:08 +07:00
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2017-01-19 12:42:27 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
|
|
|
with_dict: "{{ cinder_services }}"
|
|
|
|
notify:
|
2019-03-26 09:56:29 +00:00
|
|
|
- "Restart {{ item.key }} container"
|
2015-09-17 14:58:02 -04:00
|
|
|
|
2017-04-19 10:59:44 +01:00
|
|
|
- name: Copying over cinder-wsgi.conf
|
|
|
|
vars:
|
|
|
|
service: "{{ cinder_services['cinder-api'] }}"
|
2018-09-29 10:17:10 +01:00
|
|
|
become: true
|
2017-04-19 10:59:44 +01:00
|
|
|
template:
|
|
|
|
src: "{{ item }}"
|
|
|
|
dest: "{{ node_config_directory }}/cinder-api/cinder-wsgi.conf"
|
2019-03-22 19:18:45 +00:00
|
|
|
mode: "0660"
|
2017-04-19 10:59:44 +01:00
|
|
|
with_first_found:
|
|
|
|
- "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/cinder-wsgi.conf"
|
|
|
|
- "{{ node_custom_config }}/cinder/cinder-wsgi.conf"
|
|
|
|
- "cinder-wsgi.conf.j2"
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[service.group]
|
|
|
|
- service.enabled | bool
|
|
|
|
notify:
|
|
|
|
- Restart cinder-api container
|
|
|
|
|
2015-12-18 19:40:48 +00:00
|
|
|
- name: Copying over cinder.conf
|
2017-06-12 09:18:20 +08:00
|
|
|
vars:
|
|
|
|
service_name: "{{ item.key }}"
|
2015-12-18 19:40:48 +00:00
|
|
|
merge_configs:
|
|
|
|
sources:
|
|
|
|
- "{{ role_path }}/templates/cinder.conf.j2"
|
2016-05-19 02:39:37 -04:00
|
|
|
- "{{ node_custom_config }}/global.conf"
|
|
|
|
- "{{ node_custom_config }}/cinder.conf"
|
2017-01-19 12:42:27 +08:00
|
|
|
- "{{ node_custom_config }}/cinder/{{ item.key }}.conf"
|
2016-05-19 02:39:37 -04:00
|
|
|
- "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/cinder.conf"
|
2017-01-19 12:42:27 +08:00
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/cinder.conf"
|
2016-08-24 00:28:08 +07:00
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2017-01-19 12:42:27 +08:00
|
|
|
when:
|
|
|
|
- item.value.enabled | bool
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
with_dict: "{{ cinder_services }}"
|
|
|
|
notify:
|
2019-03-26 09:56:29 +00:00
|
|
|
- "Restart {{ item.key }} container"
|
2016-10-27 10:36:35 +02:00
|
|
|
|
2018-01-08 11:21:12 +07:00
|
|
|
- name: Copying over existing policy file
|
2018-09-29 10:17:10 +01:00
|
|
|
become: true
|
2016-10-27 10:36:35 +02:00
|
|
|
template:
|
2018-01-08 11:21:12 +07:00
|
|
|
src: "{{ cinder_policy_file_path }}"
|
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/{{ cinder_policy_file }}"
|
2019-03-22 19:18:45 +00:00
|
|
|
mode: "0660"
|
2016-10-27 10:36:35 +02:00
|
|
|
when:
|
2019-02-13 14:06:22 +08:00
|
|
|
- item.value.enabled | bool
|
2018-01-08 11:21:12 +07:00
|
|
|
- cinder_policy_file is defined
|
2017-01-19 12:42:27 +08:00
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
with_dict: "{{ cinder_services }}"
|
|
|
|
notify:
|
2019-03-26 09:56:29 +00:00
|
|
|
- "Restart {{ item.key }} container"
|
2016-02-13 23:50:46 -03:30
|
|
|
|
|
|
|
- name: Copying over nfs_shares files for cinder_volume
|
2018-09-29 10:17:10 +01:00
|
|
|
become: true
|
2016-02-13 23:50:46 -03:30
|
|
|
template:
|
2017-02-08 16:26:56 +08:00
|
|
|
src: "{{ item }}"
|
2016-02-13 23:50:46 -03:30
|
|
|
dest: "{{ node_config_directory }}/cinder-volume/nfs_shares"
|
2019-03-22 19:18:45 +00:00
|
|
|
mode: "0660"
|
2016-02-13 23:50:46 -03:30
|
|
|
with_first_found:
|
2016-11-11 14:51:14 -03:00
|
|
|
- files:
|
|
|
|
- "{{ node_custom_config }}/nfs_shares.j2"
|
|
|
|
- "{{ node_custom_config }}/cinder/nfs_shares.j2"
|
|
|
|
- "{{ node_custom_config }}/cinder/cinder-volume/nfs_shares.j2"
|
|
|
|
- "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/nfs_shares.j2"
|
2016-12-16 22:30:36 +08:00
|
|
|
- "{{ node_custom_config }}/nfs_shares"
|
|
|
|
- "{{ node_custom_config }}/cinder/nfs_shares"
|
|
|
|
- "{{ node_custom_config }}/cinder/cinder-volume/nfs_shares"
|
|
|
|
- "{{ node_custom_config }}/cinder/{{ inventory_hostname }}/nfs_shares"
|
2017-01-05 13:56:39 -03:00
|
|
|
skip: "{{ not enable_cinder_backend_nfs | bool and not enable_cinder_backend_hnas_nfs | bool }}"
|
2017-09-04 13:44:11 +01:00
|
|
|
when: inventory_hostname in groups['cinder-volume']
|
2019-03-26 09:56:29 +00:00
|
|
|
notify:
|
|
|
|
- Restart cinder-volume container
|