2016-11-15 18:51:52 +00:00
|
|
|
---
|
|
|
|
- name: Ensuring config directories exist
|
|
|
|
file:
|
2017-01-18 14:51:17 +00:00
|
|
|
path: "{{ node_config_directory }}/{{ item.key }}"
|
2016-11-15 18:51:52 +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-18 14:51:17 +00:00
|
|
|
when:
|
2019-09-24 12:57:58 +02:00
|
|
|
- item.value.host_in_groups | bool
|
2018-06-27 16:59:28 +08:00
|
|
|
- item.value.enabled | bool
|
2017-01-18 14:51:17 +00:00
|
|
|
with_dict: "{{ tacker_services }}"
|
2016-11-15 18:51:52 +00: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 }}"
|
2018-01-08 17:19:34 +07:00
|
|
|
run_once: True
|
2019-11-19 09:34:23 +00:00
|
|
|
delegate_to: localhost
|
2018-01-08 17:19:34 +07:00
|
|
|
register: tacker_policy
|
|
|
|
with_first_found:
|
|
|
|
- files: "{{ supported_policy_format_list }}"
|
|
|
|
paths:
|
|
|
|
- "{{ node_custom_config }}/tacker/"
|
|
|
|
skip: true
|
|
|
|
|
|
|
|
- name: Set tacker policy file
|
|
|
|
set_fact:
|
|
|
|
tacker_policy_file: "{{ tacker_policy.results.0.stat.path | basename }}"
|
|
|
|
tacker_policy_file_path: "{{ tacker_policy.results.0.stat.path }}"
|
|
|
|
when:
|
|
|
|
- tacker_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-11-15 18:51:52 +00:00
|
|
|
- name: Copying over config.json files for services
|
|
|
|
template:
|
2017-01-18 14:51:17 +00: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-18 14:51:17 +00:00
|
|
|
with_dict: "{{ tacker_services }}"
|
|
|
|
when:
|
2019-09-24 12:57:58 +02:00
|
|
|
- item.value.host_in_groups | bool
|
2017-01-18 14:51:17 +00:00
|
|
|
- item.value.enabled
|
|
|
|
notify:
|
2019-03-26 09:56:29 +00:00
|
|
|
- Restart {{ item.key }} container
|
2016-11-15 18:51:52 +00:00
|
|
|
|
|
|
|
- name: Copying over tacker.conf
|
2017-06-12 09:18:20 +08:00
|
|
|
vars:
|
|
|
|
service_name: "{{ item.key }}"
|
2016-11-15 18:51:52 +00:00
|
|
|
merge_configs:
|
|
|
|
sources:
|
|
|
|
- "{{ role_path }}/templates/tacker.conf.j2"
|
|
|
|
- "{{ node_custom_config }}/global.conf"
|
|
|
|
- "{{ node_custom_config }}/tacker.conf"
|
2017-01-18 14:51:17 +00:00
|
|
|
- "{{ node_custom_config }}/tacker/{{ item.key }}.conf"
|
2016-11-15 18:51:52 +00:00
|
|
|
- "{{ node_custom_config }}/tacker/{{ inventory_hostname }}/tacker.conf"
|
2017-01-18 14:51:17 +00:00
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/tacker.conf"
|
2016-08-24 00:28:08 +07:00
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2017-01-18 14:51:17 +00:00
|
|
|
with_dict: "{{ tacker_services }}"
|
|
|
|
when:
|
2019-09-24 12:57:58 +02:00
|
|
|
- item.value.host_in_groups | bool
|
2017-01-18 14:51:17 +00:00
|
|
|
- item.value.enabled | bool
|
|
|
|
notify:
|
2019-03-26 09:56:29 +00:00
|
|
|
- Restart {{ item.key }} container
|
2016-11-15 18:51:52 +00:00
|
|
|
|
2018-01-08 17:19:34 +07:00
|
|
|
- name: Copying over existing policy file
|
2016-11-15 18:51:52 +00:00
|
|
|
template:
|
2018-01-08 17:19:34 +07:00
|
|
|
src: "{{ tacker_policy_file_path }}"
|
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/{{ tacker_policy_file }}"
|
2016-08-24 00:28:08 +07:00
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2017-01-18 14:51:17 +00:00
|
|
|
when:
|
2019-09-24 12:57:58 +02:00
|
|
|
- item.value.host_in_groups | bool
|
2017-01-18 14:51:17 +00:00
|
|
|
- item.value.enabled | bool
|
2018-01-08 17:19:34 +07:00
|
|
|
- tacker_policy_file is defined
|
2017-01-18 14:51:17 +00:00
|
|
|
with_dict: "{{ tacker_services }}"
|
|
|
|
notify:
|
2019-03-26 09:56:29 +00:00
|
|
|
- Restart {{ item.key }} container
|