5ecae12fec
Co-Authored-By: caoyuan <cao.yuan@99cloud.net> Change-Id: I8855edd9e6f71012b53cda6720a4ba3e08f166e8 Partially-implements: blueprint better-reconfigure
54 lines
1.5 KiB
YAML
54 lines
1.5 KiB
YAML
---
|
|
- name: Ensuring config directories exist
|
|
file:
|
|
path: "{{ node_config_directory }}/influxdb"
|
|
state: "directory"
|
|
recurse: yes
|
|
when:
|
|
- inventory_hostname in groups[item.value.group]
|
|
- item.value.enabled | bool
|
|
with_dict: "{{ influxdb_services }}"
|
|
|
|
- name: Copying over config.json files
|
|
template:
|
|
src: "{{ item.key }}.json.j2"
|
|
dest: "{{ node_config_directory }}/influxdb/config.json"
|
|
register: influxdb_config_jsons
|
|
when:
|
|
- inventory_hostname in groups[item.value.group]
|
|
- item.value.enabled | bool
|
|
with_dict: "{{ influxdb_services }}"
|
|
notify:
|
|
- Restart influxdb container
|
|
|
|
- name: Copying over influxdb config file
|
|
vars:
|
|
service: "{{ influxdb_services['influxdb']}}"
|
|
template:
|
|
src: "{{ role_path }}/templates/{{ item }}.conf.j2"
|
|
dest: "{{ node_config_directory }}/influxdb/influxdb.conf"
|
|
register: influxdb_confs
|
|
when:
|
|
- inventory_hostname in groups[service.group]
|
|
- service.enabled | bool
|
|
with_items:
|
|
- "influxdb"
|
|
notify:
|
|
- Restart influxdb container
|
|
|
|
- name: Check influxdb 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_influxdb_containers
|
|
when:
|
|
- action != "config"
|
|
- inventory_hostname in groups[item.value.group]
|
|
- item.value.enabled | bool
|
|
with_dict: "{{ influxdb_services }}"
|
|
notify:
|
|
- Restart influxdb container
|