2015-10-17 18:13:51 +02:00
|
|
|
---
|
2015-12-18 19:40:48 +00:00
|
|
|
- name: Ensuring config directories exist
|
|
|
|
file:
|
2017-01-23 11:43:20 -03:00
|
|
|
path: "{{ node_config_directory }}/{{ item.key }}"
|
2015-12-18 19:40:48 +00:00
|
|
|
state: "directory"
|
|
|
|
recurse: yes
|
2017-02-14 11:19:26 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
2017-01-23 11:43:20 -03:00
|
|
|
with_dict: "{{ magnum_services }}"
|
2015-10-17 18:13:51 +02:00
|
|
|
|
2015-12-18 19:40:48 +00:00
|
|
|
- name: Copying over config.json files for services
|
2015-10-17 18:13:51 +02:00
|
|
|
template:
|
2017-01-23 11:43:20 -03:00
|
|
|
src: "{{ item.key }}.json.j2"
|
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
|
|
|
|
register: magnum_config_jsons
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
|
|
|
with_dict: "{{ magnum_services }}"
|
|
|
|
notify:
|
|
|
|
- Restart magnum-api container
|
|
|
|
- Restart magnum-conductor container
|
2015-10-17 18:13:51 +02:00
|
|
|
|
2015-12-18 19:40:48 +00:00
|
|
|
- name: Copying over magnum.conf
|
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/magnum.conf.j2"
|
2016-05-19 02:39:37 -04:00
|
|
|
- "{{ node_custom_config }}/global.conf"
|
|
|
|
- "{{ node_custom_config }}/magnum.conf"
|
2017-01-23 11:43:20 -03:00
|
|
|
- "{{ node_custom_config }}/magnum/{{ item.key }}.conf"
|
2016-05-19 02:39:37 -04:00
|
|
|
- "{{ node_custom_config }}/magnum/{{ inventory_hostname }}/magnum.conf"
|
2017-01-23 11:43:20 -03:00
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/magnum.conf"
|
|
|
|
register: magnum_confs
|
|
|
|
when:
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
|
|
|
with_dict: "{{ magnum_services }}"
|
|
|
|
notify:
|
|
|
|
- Restart magnum-api container
|
|
|
|
- Restart magnum-conductor container
|
2016-10-27 10:36:35 +02:00
|
|
|
|
|
|
|
- name: Check if policies shall be overwritten
|
|
|
|
local_action: stat path="{{ node_custom_config }}/magnum/policy.json"
|
2017-07-04 18:22:55 +02:00
|
|
|
run_once: True
|
2016-10-27 10:36:35 +02:00
|
|
|
register: magnum_policy
|
|
|
|
|
|
|
|
- name: Copying over existing policy.json
|
|
|
|
template:
|
|
|
|
src: "{{ node_custom_config }}/magnum/policy.json"
|
2017-01-23 11:43:20 -03:00
|
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/policy.json"
|
|
|
|
register: magnum_policy_jsons
|
|
|
|
when:
|
|
|
|
- magnum_policy.stat.exists
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
|
|
|
with_dict: "{{ magnum_services }}"
|
|
|
|
notify:
|
|
|
|
- Restart magnum-api container
|
|
|
|
- Restart magnum-conductor container
|
|
|
|
|
|
|
|
- name: Check magnum containers
|
|
|
|
kolla_docker:
|
|
|
|
action: "compare_container"
|
|
|
|
common_options: "{{ docker_common_options }}"
|
|
|
|
name: "{{ item.value.container_name }}"
|
|
|
|
image: "{{ item.value.image }}"
|
|
|
|
volumes: "{{ item.value.volumes }}"
|
2017-10-05 09:28:13 +01:00
|
|
|
environment: "{{ item.value.environment }}"
|
2017-01-23 11:43:20 -03:00
|
|
|
register: check_magnum_containers
|
2016-10-27 10:36:35 +02:00
|
|
|
when:
|
2017-01-23 11:43:20 -03:00
|
|
|
- action != "config"
|
|
|
|
- inventory_hostname in groups[item.value.group]
|
|
|
|
- item.value.enabled | bool
|
|
|
|
with_dict: "{{ magnum_services }}"
|
|
|
|
notify:
|
|
|
|
- Restart magnum-api container
|
|
|
|
- Restart magnum-conductor container
|