2015-08-02 12:26:30 -07:00
|
|
|
---
|
2015-12-18 19:40:48 +00:00
|
|
|
- name: Ensuring config directories exist
|
2016-08-23 22:34:21 +07:00
|
|
|
become: true
|
2015-12-18 19:40:48 +00:00
|
|
|
file:
|
2017-01-17 17:48:50 +08:00
|
|
|
path: "{{ node_config_directory }}/{{ item.key }}"
|
2015-12-18 19:40:48 +00:00
|
|
|
state: "directory"
|
2016-08-23 22:34:21 +07:00
|
|
|
owner: "{{ config_owner_user }}"
|
|
|
|
group: "{{ config_owner_group }}"
|
|
|
|
mode: "0770"
|
2017-02-14 11:19:26 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
2017-01-17 17:48:50 +08:00
|
|
|
with_dict: "{{ heat_services }}"
|
2015-08-02 12:26:30 -07:00
|
|
|
|
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: heat_policy
|
|
|
|
with_first_found:
|
|
|
|
- files: "{{ supported_policy_format_list }}"
|
|
|
|
paths:
|
|
|
|
- "{{ node_custom_config }}/heat/"
|
|
|
|
skip: true
|
|
|
|
|
|
|
|
- name: Set heat policy file
|
|
|
|
set_fact:
|
|
|
|
heat_policy_file: "{{ heat_policy.results.0.stat.path | basename }}"
|
|
|
|
heat_policy_file_path: "{{ heat_policy.results.0.stat.path }}"
|
|
|
|
when:
|
|
|
|
- heat_policy.results
|
|
|
|
|
2020-04-10 13:53:19 -07:00
|
|
|
- include_tasks: copy-certs.yml
|
2019-12-18 15:49:28 -08:00
|
|
|
when:
|
2020-04-23 08:24:09 -07:00
|
|
|
- kolla_copy_ca_into_containers | bool or heat_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
|
2016-08-23 22:34:21 +07:00
|
|
|
become: true
|
2015-09-17 16:46:13 -04:00
|
|
|
template:
|
2017-01-17 17:48:50 +08:00
|
|
|
src: "{{ item.key }}.json.j2"
|
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
|
2016-08-23 22:34:21 +07:00
|
|
|
mode: "0660"
|
2017-01-17 17:48:50 +08:00
|
|
|
when:
|
|
|
|
- item.value.enabled | bool
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
with_dict: "{{ heat_services }}"
|
|
|
|
notify:
|
2019-03-26 09:56:29 +00:00
|
|
|
- Restart {{ item.key }} container
|
2015-09-17 16:46:13 -04:00
|
|
|
|
2015-12-18 19:40:48 +00:00
|
|
|
- name: Copying over heat.conf
|
2016-08-23 22:34:21 +07:00
|
|
|
become: true
|
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/heat.conf.j2"
|
2016-05-19 02:39:37 -04:00
|
|
|
- "{{ node_custom_config }}/global.conf"
|
|
|
|
- "{{ node_custom_config }}/heat.conf"
|
2017-01-17 17:48:50 +08:00
|
|
|
- "{{ node_custom_config }}/heat/{{ item.key }}.conf"
|
2016-05-19 02:39:37 -04:00
|
|
|
- "{{ node_custom_config }}/heat/{{ inventory_hostname }}/heat.conf"
|
2017-01-17 17:48:50 +08:00
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/heat.conf"
|
2016-08-23 22:34:21 +07:00
|
|
|
mode: "0660"
|
2017-01-17 17:48:50 +08:00
|
|
|
when:
|
|
|
|
- item.value.enabled | bool
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
with_dict: "{{ heat_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 15:13:03 +07:00
|
|
|
- name: Copying over existing policy file
|
2016-08-23 22:34:21 +07:00
|
|
|
become: true
|
2016-10-27 10:36:35 +02:00
|
|
|
template:
|
2018-01-08 15:13:03 +07:00
|
|
|
src: "{{ heat_policy_file_path }}"
|
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/{{ heat_policy_file }}"
|
2016-08-23 22:34:21 +07:00
|
|
|
mode: "0660"
|
2017-01-17 17:48:50 +08:00
|
|
|
when:
|
2018-01-08 15:13:03 +07:00
|
|
|
- heat_policy_file is defined
|
2019-03-26 09:56:29 +00:00
|
|
|
- item.value.enabled | bool
|
2017-01-17 17:48:50 +08:00
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
with_dict: "{{ heat_services }}"
|
|
|
|
notify:
|
2019-03-26 09:56:29 +00:00
|
|
|
- Restart {{ item.key }} container
|
2017-01-17 17:48:50 +08:00
|
|
|
|
2020-04-23 08:24:09 -07:00
|
|
|
- name: Copying over heat-api wsgi config
|
|
|
|
vars:
|
|
|
|
service: "{{ heat_services['heat-api'] }}"
|
|
|
|
template:
|
|
|
|
src: "{{ role_path }}/templates/wsgi-heat-api.conf.j2"
|
|
|
|
dest: "{{ node_config_directory }}/heat-api/wsgi-heat-api.conf"
|
|
|
|
mode: "0660"
|
|
|
|
become: true
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[service['group']]
|
|
|
|
- service.enabled | bool
|
|
|
|
notify:
|
|
|
|
- Restart heat-api container
|
|
|
|
|
|
|
|
- name: Copying over heat-api-cfn wsgi config
|
|
|
|
vars:
|
|
|
|
service: "{{ heat_services['heat-api-cfn'] }}"
|
|
|
|
template:
|
|
|
|
src: "{{ role_path }}/templates/wsgi-heat-api-cfn.conf.j2"
|
|
|
|
dest: "{{ node_config_directory }}/heat-api-cfn/wsgi-heat-api-cfn.conf"
|
|
|
|
mode: "0660"
|
|
|
|
become: true
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[service['group']]
|
|
|
|
- service.enabled | bool
|
|
|
|
notify:
|
|
|
|
- Restart heat-api-cfn container
|