Merge "Include {{step}} when setting facts" into stable/train
This commit is contained in:
commit
5323f2033e
|
@ -224,8 +224,8 @@
|
||||||
|
|
||||||
- name: Calculate container_puppet_tasks for {{ansible_hostname | lower}} step {{step}}
|
- name: Calculate container_puppet_tasks for {{ansible_hostname | lower}} step {{step}}
|
||||||
set_fact:
|
set_fact:
|
||||||
host_container_puppet_tasks: "{{host_container_puppet_tasks|default([]) + [item]}}"
|
"{{'host_container_puppet_tasks_' ~ step}}": "{{lookup('vars', 'host_container_puppet_tasks_' ~ step, default=[]) | union([item])}}"
|
||||||
loop: "{{container_puppet_tasks.get('step_' + step, [])}}"
|
loop: "{{container_puppet_tasks.get('step_' ~ step, [])}}"
|
||||||
when: (groups[item.service_name] | default ([]) | map('extract', hostvars, 'inventory_hostname') | sort | first | lower) == ansible_hostname | lower
|
when: (groups[item.service_name] | default ([]) | map('extract', hostvars, 'inventory_hostname') | sort | first | lower) == ansible_hostname | lower
|
||||||
vars:
|
vars:
|
||||||
container_puppet_tasks: "{{ lookup('file', tripleo_role_name + '/container_puppet_tasks.yaml', errors='ignore') | default({}, True) | from_yaml }}"
|
container_puppet_tasks: "{{ lookup('file', tripleo_role_name + '/container_puppet_tasks.yaml', errors='ignore') | default({}, True) | from_yaml }}"
|
||||||
|
@ -234,6 +234,6 @@
|
||||||
|
|
||||||
- name: Include container-puppet tasks for step {{step}}
|
- name: Include container-puppet tasks for step {{step}}
|
||||||
include_tasks: host-container-puppet-tasks.yaml
|
include_tasks: host-container-puppet-tasks.yaml
|
||||||
when: host_container_puppet_tasks is defined
|
when: ('host_container_puppet_tasks_' ~ step) is defined
|
||||||
tags:
|
tags:
|
||||||
- container_config_tasks
|
- container_config_tasks
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
- name: Write container-puppet-tasks json file for {{ansible_hostname | lower}} step {{step}}
|
- name: Write container-puppet-tasks json file for {{ansible_hostname | lower}} step {{step}}
|
||||||
no_log: True
|
no_log: True
|
||||||
copy:
|
copy:
|
||||||
content: "{{host_container_puppet_tasks|to_nice_json}}"
|
content: "{{lookup ('vars', 'host_container_puppet_tasks_' ~ step, default=[]) | to_nice_json}}"
|
||||||
dest: "/var/lib/container-puppet/container-puppet-tasks{{step}}.json"
|
dest: "/var/lib/container-puppet/container-puppet-tasks{{step}}.json"
|
||||||
force: yes
|
force: yes
|
||||||
mode: '0600'
|
mode: '0600'
|
||||||
|
|
Loading…
Reference in New Issue