2016-07-08 19:12:50 +02:00
|
|
|
---
|
|
|
|
- name: Ensuring config directories exist
|
|
|
|
file:
|
2017-01-20 23:36:43 +08:00
|
|
|
path: "{{ node_config_directory }}/{{ item.key }}"
|
2016-07-08 19:12:50 +02:00
|
|
|
state: "directory"
|
2016-08-24 00:28:08 +07:00
|
|
|
owner: "{{ config_owner_user }}"
|
|
|
|
group: "{{ config_owner_group }}"
|
|
|
|
mode: "0770"
|
|
|
|
become: true
|
2017-02-14 11:19:26 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
2017-01-20 23:36:43 +08:00
|
|
|
with_dict: "{{ senlin_services }}"
|
2016-07-08 19:12:50 +02:00
|
|
|
|
2018-01-08 17:19:34 +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 17:19:34 +07:00
|
|
|
run_once: True
|
|
|
|
register: senlin_policy
|
|
|
|
with_first_found:
|
|
|
|
- files: "{{ supported_policy_format_list }}"
|
|
|
|
paths:
|
|
|
|
- "{{ node_custom_config }}/senlin/"
|
|
|
|
skip: true
|
|
|
|
|
|
|
|
- name: Set senlin policy file
|
|
|
|
set_fact:
|
|
|
|
senlin_policy_file: "{{ senlin_policy.results.0.stat.path | basename }}"
|
|
|
|
senlin_policy_file_path: "{{ senlin_policy.results.0.stat.path }}"
|
|
|
|
when:
|
|
|
|
- senlin_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-07-08 19:12:50 +02:00
|
|
|
- name: Copying over config.json files for services
|
|
|
|
template:
|
2017-01-20 23:36:43 +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-20 23:36:43 +08:00
|
|
|
when:
|
|
|
|
- item.value.enabled | bool
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
with_dict: "{{ senlin_services }}"
|
|
|
|
notify:
|
2019-03-26 09:56:29 +00:00
|
|
|
- Restart {{ item.key }} container
|
2016-07-08 19:12:50 +02:00
|
|
|
|
|
|
|
- name: Copying over senlin.conf
|
2017-06-12 09:18:20 +08:00
|
|
|
vars:
|
|
|
|
service_name: "{{ item.key }}"
|
2016-07-08 19:12:50 +02:00
|
|
|
merge_configs:
|
|
|
|
sources:
|
|
|
|
- "{{ role_path }}/templates/senlin.conf.j2"
|
|
|
|
- "{{ node_custom_config }}/global.conf"
|
|
|
|
- "{{ node_custom_config }}/senlin.conf"
|
2017-01-20 23:36:43 +08:00
|
|
|
- "{{ node_custom_config }}/senlin/{{ item.key }}.conf"
|
2016-07-08 19:12:50 +02:00
|
|
|
- "{{ node_custom_config }}/senlin/{{ inventory_hostname }}/senlin.conf"
|
2017-01-20 23:36:43 +08:00
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/senlin.conf"
|
2016-08-24 00:28:08 +07:00
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2017-01-20 23:36:43 +08:00
|
|
|
when:
|
|
|
|
- item.value.enabled | bool
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
with_dict: "{{ senlin_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 17:19:34 +07:00
|
|
|
- name: Copying over existing policy file
|
2016-10-27 10:36:35 +02:00
|
|
|
template:
|
2018-01-08 17:19:34 +07:00
|
|
|
src: "{{ senlin_policy_file_path }}"
|
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/{{ senlin_policy_file }}"
|
2016-08-24 00:28:08 +07:00
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2017-01-20 23:36:43 +08:00
|
|
|
when:
|
2018-01-08 17:19:34 +07:00
|
|
|
- senlin_policy_file is defined
|
2017-01-20 23:36:43 +08:00
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
|
|
|
with_dict: "{{ senlin_services }}"
|
|
|
|
notify:
|
2019-03-26 09:56:29 +00:00
|
|
|
- Restart {{ item.key }} container
|