2016-03-01 10:46:48 -05:00
|
|
|
---
|
|
|
|
- name: Ensuring config directories exist
|
|
|
|
file:
|
2017-01-17 13:33:32 -03:00
|
|
|
path: "{{ node_config_directory }}/{{ item.key }}"
|
2016-03-01 10:46:48 -05: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-17 13:33:32 -03:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
|
|
|
with_dict: "{{ manila_services }}"
|
2016-03-01 10:46:48 -05:00
|
|
|
|
2018-09-25 12:37:26 +01:00
|
|
|
- include_tasks: external_ceph.yml
|
|
|
|
when:
|
|
|
|
- (enable_manila_backend_cephfs_native | bool) or (enable_manila_backend_cephfs_nfs | bool)
|
|
|
|
- inventory_hostname in groups['manila-share']
|
|
|
|
|
2018-01-08 15:13:03 +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 15:13:03 +07:00
|
|
|
run_once: True
|
|
|
|
register: manila_policy
|
|
|
|
with_first_found:
|
|
|
|
- files: "{{ supported_policy_format_list }}"
|
|
|
|
paths:
|
|
|
|
- "{{ node_custom_config }}/manila/"
|
|
|
|
skip: true
|
|
|
|
|
|
|
|
- name: Set manila policy file
|
|
|
|
set_fact:
|
|
|
|
manila_policy_file: "{{ manila_policy.results.0.stat.path | basename }}"
|
|
|
|
manila_policy_file_path: "{{ manila_policy.results.0.stat.path }}"
|
|
|
|
when:
|
|
|
|
- manila_policy.results
|
|
|
|
|
2020-04-10 13:53:19 -07:00
|
|
|
- include_tasks: copy-certs.yml
|
2019-12-18 15:49:28 -08:00
|
|
|
when:
|
|
|
|
- kolla_copy_ca_into_containers | bool
|
|
|
|
|
2016-03-01 10:46:48 -05:00
|
|
|
- name: Copying over config.json files for services
|
|
|
|
template:
|
2017-01-17 13:33:32 -03: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-17 13:33:32 -03:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
|
|
|
with_dict: "{{ manila_services }}"
|
|
|
|
notify:
|
|
|
|
- "Restart {{ item.key }} container"
|
2016-03-01 10:46:48 -05:00
|
|
|
|
|
|
|
- name: Copying over manila.conf
|
2017-06-12 09:18:20 +08:00
|
|
|
vars:
|
|
|
|
service_name: "{{ item.key }}"
|
2016-03-01 10:46:48 -05:00
|
|
|
merge_configs:
|
|
|
|
sources:
|
|
|
|
- "{{ role_path }}/templates/manila.conf.j2"
|
2016-04-29 15:31:53 -04:00
|
|
|
- "{{ node_custom_config }}/global.conf"
|
|
|
|
- "{{ node_custom_config }}/manila.conf"
|
2017-01-17 13:33:32 -03:00
|
|
|
- "{{ node_custom_config }}/manila/{{ item.key }}.conf"
|
2016-04-29 15:31:53 -04:00
|
|
|
- "{{ node_custom_config }}/manila/{{ inventory_hostname }}/manila.conf"
|
2017-01-17 13:33:32 -03:00
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/manila.conf"
|
2016-08-24 00:28:08 +07:00
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2017-01-17 13:33:32 -03:00
|
|
|
when:
|
|
|
|
- item.key in [ "manila-api", "manila-data", "manila-scheduler" ]
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
|
|
|
with_dict: "{{ manila_services }}"
|
|
|
|
notify:
|
2019-03-26 09:56:29 +00:00
|
|
|
- Restart {{ item.key }} container
|
2016-04-29 15:31:53 -04:00
|
|
|
|
|
|
|
- name: Copying over manila-share.conf
|
2017-01-17 13:33:32 -03:00
|
|
|
vars:
|
|
|
|
service: "{{ manila_services['manila-share'] }}"
|
2017-06-12 09:18:20 +08:00
|
|
|
service_name: "{{ item }}"
|
2016-04-29 15:31:53 -04:00
|
|
|
merge_configs:
|
|
|
|
sources:
|
|
|
|
- "{{ role_path }}/templates/manila.conf.j2"
|
|
|
|
- "{{ role_path }}/templates/manila-share.conf.j2"
|
|
|
|
- "{{ node_custom_config }}/global.conf"
|
|
|
|
- "{{ node_custom_config }}/manila.conf"
|
2016-09-06 12:30:08 -04:00
|
|
|
- "{{ node_custom_config }}/{{ item }}.conf"
|
2016-04-29 15:31:53 -04:00
|
|
|
- "{{ node_custom_config }}/manila/{{ item }}.conf"
|
|
|
|
- "{{ node_custom_config }}/manila/{{ inventory_hostname }}/manila.conf"
|
|
|
|
dest: "{{ node_config_directory }}/{{ item }}/manila.conf"
|
2016-08-24 00:28:08 +07:00
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2017-01-17 13:33:32 -03:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[service.group]
|
|
|
|
- service.enabled | bool
|
2016-04-29 15:31:53 -04:00
|
|
|
with_items:
|
2016-03-01 10:46:48 -05:00
|
|
|
- "manila-share"
|
2017-01-17 13:33:32 -03:00
|
|
|
notify:
|
|
|
|
- Restart manila-share container
|
2016-10-27 10:36:35 +02:00
|
|
|
|
2018-01-08 15:13:03 +07:00
|
|
|
- name: Copying over existing policy file
|
2016-10-27 10:36:35 +02:00
|
|
|
template:
|
2018-01-08 15:13:03 +07:00
|
|
|
src: "{{ manila_policy_file_path }}"
|
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/{{ manila_policy_file }}"
|
2019-03-22 19:18:45 +00:00
|
|
|
mode: "0660"
|
2017-01-17 13:33:32 -03:00
|
|
|
when:
|
2018-01-08 15:13:03 +07:00
|
|
|
- manila_policy_file is defined
|
2017-01-17 13:33:32 -03:00
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
|
|
|
with_dict: "{{ manila_services }}"
|
|
|
|
notify:
|
|
|
|
- "Restart {{ item.key }} container"
|