1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/delegate_to/delegate_facts_block.yml
Brian Coca 8743e6ae2e remove default from delegate_facts to inherit (#45492)
* remove default from delegate_facts to inherit

fixes #45456

* test delegate_facts

* added note about inheritance and defaults

* yamllint
2018-10-10 15:10:23 -04:00

25 lines
668 B
YAML

- hosts: testhost
gather_facts: false
tasks:
- name: set var to delegated host directly
set_fact: qq1=333
delegate_facts: true
delegate_to: localhost
- name: ensure qq1 exists in localhost but not in testhost
assert:
that:
- qq1 is undefined
- "'qq1' in hostvars['localhost']"
- name: set var to delegated host via inheritance
block:
- set_fact: qq2=333
delegate_facts: true
delegate_to: localhost
- name: ensure qq2 exists in localhost but not in testhost
assert:
that:
- qq2 is undefined
- "'qq2' in hostvars['localhost']"