Merge "Cleanup all container startup configs before generating the new ones"

This commit is contained in:
Zuul 2020-07-03 20:15:12 +00:00 committed by Gerrit Code Review
commit 66e728c278
1 changed files with 11 additions and 6 deletions

View File

@ -1,18 +1,23 @@
---
- set_fact:
step_path: "{{ item.0 }}"
- name: "Create directory for {{ step_path }} container startup configs"
# TODO(emilien) convert this whole task in a module
# https://bugs.launchpad.net/tripleo/+bug/1884577
- name: "Remove old {{ item.0 }} container startup configs"
file:
path: "/var/lib/tripleo-config/container-startup-config/{{ step_path }}/"
path: "/var/lib/tripleo-config/container-startup-config/{{ item.0 }}"
state: absent
- name: "Create directory for {{ item.0 }} container startup configs"
file:
path: "/var/lib/tripleo-config/container-startup-config/{{ item.0 }}/"
mode: 0600
recurse: yes
setype: container_file_t
- name: "Creating container startup configs for {{ step_path }}"
- name: "Creating container startup configs for {{ item.0 }}"
copy:
content: "{{ startup_data.value | to_nice_json }}"
dest: "/var/lib/tripleo-config/container-startup-config/{{ step_path }}/{{ startup_data.key }}.json"
dest: "/var/lib/tripleo-config/container-startup-config/{{ item.0 }}/{{ startup_data.key }}.json"
setype: container_file_t
mode: 0600
no_log: true