Merge "Convert with_dict tasks to use loop and be less chatty"

changes/98/604298/20
Zuul 4 years ago committed by Gerrit Code Review
commit 9f93bb7a9e
  1. 38
      common/deploy-steps-tasks.yaml

@ -71,12 +71,14 @@
- name: Write docker config scripts
copy:
content: "{{ item.value.content }}"
dest: "/var/lib/docker-config-scripts/{{ item.key }}"
content: "{{ item[1].content }}"
dest: "/var/lib/docker-config-scripts/{{ item[0] }}"
force: yes
mode: "{{ item.value.mode | default('0600', true) }}"
setype: svirt_sandbox_file_t
with_dict: "{{ role_data_docker_config_scripts }}"
mode: "{{ item[1].mode | default('0600', true) }}"
setype: svirt_sandbox_file_t
loop: "{{ role_data_docker_config_scripts | dictsort }}"
loop_control:
label: "{{ item[0] }}"
vars:
role_data_docker_config_scripts: "{{ lookup('file', tripleo_role_name + '/docker_config_scripts.yaml', errors='ignore') | default({}, True) | from_yaml }}"
tags:
@ -116,11 +118,13 @@
- name: Write per-step docker-container-startup-configs
copy:
content: "{{ item.value | to_json }}"
dest: "/var/lib/tripleo-config/docker-container-startup-config-{{ item.key }}.json"
content: "{{ item[1] | to_json }}"
dest: "/var/lib/tripleo-config/docker-container-startup-config-{{ item[0] }}.json"
force: yes
mode: '0600'
with_dict: "{{ docker_config_with_default }}"
loop: "{{ docker_config_with_default | dictsort }}"
loop_control:
label: "{{ item[0] }}"
tags:
- container_startup_configs
@ -143,12 +147,14 @@
- name: Write kolla config json files
copy:
content: "{{ item.value | to_json }}"
dest: "{{ item.key }}"
content: "{{ item[1] | to_json }}"
dest: "{{ item[0] }}"
force: yes
mode: '0600'
setype: svirt_sandbox_file_t
with_dict: "{{ lookup('file', tripleo_role_name + '/kolla_config.yaml', errors='ignore') | default([], True) | from_yaml }}"
setype: svirt_sandbox_file_t
loop: "{{ lookup('file', tripleo_role_name + '/kolla_config.yaml', errors='ignore') | default([], True) | from_yaml | dictsort }}"
loop_control:
label: "{{ item[0] }}"
tags:
- container_startup_configs
@ -168,11 +174,13 @@
- name: Write docker-puppet-tasks json files
copy:
content: "{{item.value|to_json}}"
dest: /var/lib/docker-puppet/docker-puppet-tasks{{item.key.replace("step_", "")}}.json
content: "{{item[1]|to_json}}"
dest: /var/lib/docker-puppet/docker-puppet-tasks{{item[0].replace("step_", "")}}.json
force: yes
mode: '0600'
with_dict: "{{ lookup('file', tripleo_role_name + '/docker_puppet_tasks.yaml', errors='ignore') | default({}, True) | from_yaml }}"
loop: "{{ lookup('file', tripleo_role_name + '/docker_puppet_tasks.yaml', errors='ignore') | default({}, True) | from_yaml | dictsort }}"
loop_control:
label: "{{ item[0] }}"
when: deploy_server_id == bootstrap_server_id
tags:
- container_config_tasks

Loading…
Cancel
Save