mirror of https://github.com/ansible/ansible.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
668 B
YAML
26 lines
668 B
YAML
6 years ago
|
- 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']"
|