Create Container configs with a new module

To avoid the repetition of the copy module in a loop for each config,
which increases deployment time at scale, replace it via a module that
will run faster to create the json files.

Depends-On: https://review.opendev.org/746214
Change-Id: I3ba96d6e4a0217d32c086f99a27e3e85db21c082
This commit is contained in:
Emilien Macchi 2020-08-13 14:56:05 -04:00
parent ef83e08422
commit a266382244
1 changed files with 3 additions and 11 deletions

View File

@ -270,18 +270,10 @@
setype: container_file_t setype: container_file_t
selevel: s0 selevel: s0
- name: Write kolla config json files - name: Write container config json files
become: true become: true
no_log: True tripleo_container_configs:
copy: config_data: "{{ lookup('file', tripleo_role_name + '/kolla_config.yaml', errors='ignore') | default({}, True) | from_yaml }}"
content: "{{ item[1] | to_nice_json }}"
dest: "{{ item[0] }}"
force: yes
mode: '0600'
setype: container_file_t
loop: "{{ lookup('file', tripleo_role_name + '/kolla_config.yaml', errors='ignore') | default([], True) | from_yaml | dictsort }}"
loop_control:
label: "{{ item[0] }}"
tags: tags:
- container_startup_configs - container_startup_configs