Last active
January 5, 2017 16:11
-
-
Save vascoosx/4fe2fa1ba8cc644ce93402ae41ed201f to your computer and use it in GitHub Desktop.
incrementally add facts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
connection: local | |
tasks: | |
- name: check | |
local_action: debug msg={{ item.name }} | |
with_items: | |
- "{{ files }}" | |
- name: register data | |
set_fact: | |
file_details: "{{ file_details|default({}) | combine( {item.name: { 'revision' : item.revision }} ) }}" | |
with_items: | |
- "{{ files }}" | |
- name: see dict | |
debug: msg="{{ file_details[item.name] }}" | |
with_items: | |
- "{{ files }}" | |
- name: register second data | |
set_fact: | |
file_details2: "{{ file_details[item.name] | combine( { 'path' : item.location }) }}" | |
with_items: | |
- "{{ files }}" | |
- name: check registration | |
debug: msg="{{ file_details2 }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment