2016-08-04 06:51:11 +00:00
|
|
|
---
|
|
|
|
- name: Ensuring config directories exist
|
|
|
|
file:
|
2017-01-21 23:48:18 +08:00
|
|
|
path: "{{ node_config_directory }}/{{ item.key }}"
|
2016-08-04 06:51:11 +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-21 23:48:18 +08:00
|
|
|
when:
|
|
|
|
- item.value.enabled | bool
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
with_dict: "{{ aodh_services }}"
|
2016-08-04 06:51:11 +00:00
|
|
|
|
2017-10-24 15:49:05 +07:00
|
|
|
- name: Check if policies shall be overwritten
|
2019-11-19 09:34:23 +00:00
|
|
|
stat:
|
|
|
|
path: "{{ item }}"
|
2017-10-24 15:49:05 +07:00
|
|
|
run_once: True
|
2019-11-19 09:34:23 +00:00
|
|
|
delegate_to: localhost
|
2017-10-24 15:49:05 +07:00
|
|
|
register: aodh_policy
|
|
|
|
with_first_found:
|
|
|
|
- files: "{{ supported_policy_format_list }}"
|
|
|
|
paths:
|
|
|
|
- "{{ node_custom_config }}/aodh/"
|
|
|
|
skip: true
|
|
|
|
|
2018-09-21 17:16:33 +02:00
|
|
|
- name: Set aodh policy file
|
2017-10-24 15:49:05 +07:00
|
|
|
set_fact:
|
|
|
|
aodh_policy_file: "{{ aodh_policy.results.0.stat.path | basename }}"
|
|
|
|
aodh_policy_file_path: "{{ aodh_policy.results.0.stat.path }}"
|
|
|
|
when:
|
|
|
|
- aodh_policy.results
|
|
|
|
|
|
|
|
- name: Copying over existing policy file
|
|
|
|
template:
|
|
|
|
src: "{{ aodh_policy_file_path }}"
|
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/{{ aodh_policy_file }}"
|
2016-08-24 00:28:08 +07:00
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2017-10-24 15:49:05 +07:00
|
|
|
when:
|
|
|
|
- aodh_policy_file is defined
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
|
|
|
with_dict: "{{ aodh_services }}"
|
|
|
|
notify:
|
2019-03-26 09:56:29 +00:00
|
|
|
- "Restart {{ item.key }} container"
|
2017-10-24 15:49:05 +07:00
|
|
|
|
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-08-04 06:51:11 +00:00
|
|
|
- name: Copying over config.json files for services
|
|
|
|
template:
|
2017-01-21 23:48:18 +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-21 23:48:18 +08:00
|
|
|
when:
|
|
|
|
- item.value.enabled | bool
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
with_dict: "{{ aodh_services }}"
|
|
|
|
notify:
|
2019-03-26 09:56:29 +00:00
|
|
|
- "Restart {{ item.key }} container"
|
2016-08-04 06:51:11 +00:00
|
|
|
|
|
|
|
- name: Copying over aodh.conf
|
2017-06-12 09:18:20 +08:00
|
|
|
vars:
|
|
|
|
service_name: "{{ item.key }}"
|
2016-08-04 06:51:11 +00:00
|
|
|
merge_configs:
|
|
|
|
sources:
|
|
|
|
- "{{ role_path }}/templates/aodh.conf.j2"
|
|
|
|
- "{{ node_custom_config }}/global.conf"
|
|
|
|
- "{{ node_custom_config }}/aodh.conf"
|
2017-01-21 23:48:18 +08:00
|
|
|
- "{{ node_custom_config }}/aodh/{{ item.key }}.conf"
|
2016-12-01 10:59:33 +00:00
|
|
|
- "{{ node_custom_config }}/aodh/{{ inventory_hostname }}/aodh.conf"
|
2017-01-21 23:48:18 +08:00
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/aodh.conf"
|
2016-08-24 00:28:08 +07:00
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2017-01-21 23:48:18 +08:00
|
|
|
when:
|
|
|
|
- item.value.enabled | bool
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
with_dict: "{{ aodh_services }}"
|
|
|
|
notify:
|
2019-03-26 09:56:29 +00:00
|
|
|
- "Restart {{ item.key }} container"
|
2016-08-04 06:51:11 +00:00
|
|
|
|
|
|
|
- name: Copying over wsgi-aodh files for services
|
2017-01-21 23:48:18 +08:00
|
|
|
vars:
|
|
|
|
service: "{{ aodh_services['aodh-api'] }}"
|
2016-08-04 06:51:11 +00:00
|
|
|
template:
|
|
|
|
src: "wsgi-aodh.conf.j2"
|
2017-01-21 23:48:18 +08:00
|
|
|
dest: "{{ node_config_directory }}/aodh-api/wsgi-aodh.conf"
|
2016-08-24 00:28:08 +07:00
|
|
|
mode: "0660"
|
|
|
|
become: true
|
2017-01-21 23:48:18 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[service.group]
|
|
|
|
- service.enabled | bool
|
|
|
|
notify:
|
2019-03-26 09:56:29 +00:00
|
|
|
- "Restart aodh-api container"
|