Last active
February 21, 2018 18:59
-
-
Save anryko/8a466db2058369676ddf462b569324c9 to your computer and use it in GitHub Desktop.
ansible_combine.yml
This file contains 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
# x → {'a': 111, 'b': 222, 'c': 333} | |
- set_fact: | |
x: "{{ x | d({}) | combine({item.0: item.1}) }}" | |
with_together: | |
- ['a', 'b', 'c'] | |
- [111, 222, 333] | |
# y → [{'a':123}, {'b':456}, {'c':789}] | |
- set_fact: | |
y: "{{ y | d([]) | union([{item.0: item.1}]) }}" | |
with_together: | |
- ['a', 'b', 'c'] | |
- [111, 222, 333] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment