73 lines
2.1 KiB
YAML
73 lines
2.1 KiB
YAML
---
|
|
- name: Ensuring config directories exist
|
|
file:
|
|
path: "{{ node_config_directory }}/{{ item.key }}"
|
|
state: "directory"
|
|
recurse: yes
|
|
when:
|
|
- inventory_hostname in groups[item.value.group]
|
|
- item.value.enabled | bool
|
|
with_dict: "{{ rally_services }}"
|
|
|
|
- name: Copying over config.json files for services
|
|
template:
|
|
src: "{{ item.key }}.json.j2"
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
|
|
register: rally_config_jsons
|
|
when:
|
|
- item.value.enabled | bool
|
|
- inventory_hostname in groups[item.value.group]
|
|
with_dict: "{{ rally_services }}"
|
|
notify:
|
|
- Restart rally container
|
|
|
|
- name: Copying over rally.conf
|
|
vars:
|
|
service_name: "{{ item.key }}"
|
|
merge_configs:
|
|
sources:
|
|
- "{{ role_path }}/templates/rally.conf.j2"
|
|
- "{{ node_custom_config }}/rally.conf"
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/{{ item.key }}.conf"
|
|
register: rally_confs
|
|
when:
|
|
- item.value.enabled | bool
|
|
- inventory_hostname in groups[item.value.group]
|
|
with_dict: "{{ rally_services }}"
|
|
notify:
|
|
- Restart rally container
|
|
|
|
- name: Check if policies shall be overwritten
|
|
local_action: stat path="{{ node_custom_config }}/rally/policy.json"
|
|
run_once: True
|
|
register: rally_policy
|
|
|
|
- name: Copying over existing policy.json
|
|
template:
|
|
src: "{{ node_custom_config }}/rally/policy.json"
|
|
dest: "{{ node_config_directory }}/{{ item.key }}/policy.json"
|
|
register: rally_policy_jsons
|
|
when:
|
|
- rally_policy.stat.exists
|
|
- inventory_hostname in groups[item.value.group]
|
|
- item.value.enabled | bool
|
|
with_dict: "{{ rally_services }}"
|
|
notify:
|
|
- Restart rally container
|
|
|
|
- name: Check rally containers
|
|
kolla_docker:
|
|
action: "compare_container"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "{{ item.value.container_name }}"
|
|
image: "{{ item.value.image }}"
|
|
volumes: "{{ item.value.volumes }}"
|
|
register: check_rally_containers
|
|
when:
|
|
- action != "config"
|
|
- inventory_hostname in groups[item.value.group]
|
|
- item.value.enabled | bool
|
|
with_dict: "{{ rally_services }}"
|
|
notify:
|
|
- Restart rally container
|