Browse Source

combine example

master
Nicolas Massé 5 years ago
parent
commit
7fcaee1c05
  1. 5
      combine.yaml

5
combine.yaml

@ -1,6 +1,6 @@
--- ---
- name: TODO - name: Merge two hashes with combine
gather_facts: no gather_facts: no
hosts: localhost hosts: localhost
tasks: tasks:
@ -13,6 +13,7 @@
- output.spec.firstname == "jane" - output.spec.firstname == "jane"
- output.spec.lastname == "doe" - output.spec.lastname == "doe"
- output.extended_spec.age == 21 - output.extended_spec.age == 21
- output.extra.knows == "ansible"
vars: vars:
output: "{{ input1|combine(input2, recursive=True) }}" output: "{{ input1|combine(input2, recursive=True) }}"
input1: input1:
@ -26,5 +27,7 @@
firstname: jane firstname: jane
extended_spec: extended_spec:
age: 21 age: 21
extra:
knows: ansible

Loading…
Cancel
Save