30be04ea91
Add become to all tasks that use the module "kolla_docker" Change-Id: I4309c4011687b88ec31d739fd8f834fe2326ff10 Partial-Implements: blueprint ansible-specific-task-become
53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
---
|
|
- name: Ensuring config directories exist
|
|
file:
|
|
path: "{{ node_config_directory }}/{{ item }}"
|
|
state: "directory"
|
|
owner: "{{ config_owner_user }}"
|
|
group: "{{ config_owner_group }}"
|
|
mode: "0770"
|
|
become: true
|
|
with_items:
|
|
- "chrony"
|
|
|
|
- name: Copying over config.json files for services
|
|
template:
|
|
src: "{{ item }}.json.j2"
|
|
dest: "{{ node_config_directory }}/{{ item }}/config.json"
|
|
mode: "0660"
|
|
become: true
|
|
with_items:
|
|
- "chrony"
|
|
notify:
|
|
- Restart chrony container
|
|
|
|
- name: Copying over chrony.conf
|
|
template:
|
|
src: "{{ item }}"
|
|
dest: "{{ node_config_directory }}/chrony/chrony.conf"
|
|
mode: "0660"
|
|
become: true
|
|
with_first_found:
|
|
- "{{ node_custom_config }}/chrony/{{ inventory_hostname }}/chrony.conf"
|
|
- "{{ node_custom_config }}/chrony/chrony.conf"
|
|
- "chrony.conf.j2"
|
|
notify:
|
|
- Restart chrony container
|
|
|
|
- name: Check chrony container
|
|
become: true
|
|
kolla_docker:
|
|
action: "compare_container"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "{{ item.value.container_name }}"
|
|
image: "{{ item.value.image }}"
|
|
privileged: "{{ item.value.privileged }}"
|
|
volumes: "{{ item.value.volumes }}"
|
|
when:
|
|
- kolla_action != "config"
|
|
- inventory_hostname in groups[item.value.group]
|
|
- item.value.enabled | bool
|
|
with_dict: "{{ chrony_services }}"
|
|
notify:
|
|
- Restart chrony container
|