mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
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
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
- 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']"
|
||||
@@ -10,3 +10,5 @@ ansible-playbook test_loop_control.yml -v "$@"
|
||||
ansible-playbook test_delegate_to_loop_randomness.yml -v "$@"
|
||||
|
||||
ansible-playbook delegate_and_nolog.yml -v "$@"
|
||||
|
||||
ansible-playbook delegate_facts_block.yml -v "$@"
|
||||
|
||||
Reference in New Issue
Block a user