ansible/test/integration/targets/gathering_facts/verify_merge_facts.yml
Brian Coca 9281148b62
correctly merge multiple facts results (#68987)
* correctly merge multiple facts results

  fixes #68532
2020-05-20 18:53:37 -04:00

41 lines
1 KiB
YAML

- name: rune one and two, verify merge is as expected
hosts: localhost
vars:
ansible_facts_modules:
- facts_one
- facts_two
tasks:
- name: populate original
include_vars:
name: original
file: one_two.json
- name: fail if ref file is updated
assert:
msg: '{{ansible_facts}} vs {{original}}'
that:
- ansible_facts|to_json(indent=4, sort_keys=True) == original|to_json(indent=4, sort_keys=True)
- name: clear existing facts for next play
meta: clear_facts
- name: rune two and one, verify merge is as expected
hosts: localhost
vars:
ansible_facts_modules:
- facts_two
- facts_one
tasks:
- name: populate original
include_vars:
name: original
file: two_one.json
- name: fail if ref file is updated
assert:
msg: '{{ansible_facts}} vs {{original}}'
that:
- ansible_facts|to_json(indent=4, sort_keys=True) == original|to_json(indent=4, sort_keys=True)