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.
24 lines
732 B
YAML
24 lines
732 B
YAML
6 years ago
|
- hosts: testhost
|
||
|
tasks:
|
||
|
- name: check that facts were gathered but no local facts exist
|
||
|
assert:
|
||
|
that:
|
||
|
- ansible_facts is defined and 'fqdn' in ansible_facts
|
||
|
- not 'uuid' in ansible_local
|
||
|
- name: create 'local facts' for next gathering
|
||
|
copy:
|
||
|
src: uuid.fact
|
||
|
dest: /etc/ansible/facts.d/
|
||
|
mode: 0755
|
||
|
|
||
|
- hosts: testhost
|
||
|
tasks:
|
||
|
- name: ensure facts are gathered and includes the new 'local facts' created above
|
||
|
assert:
|
||
|
that:
|
||
|
- ansible_facts is defined and 'fqdn' in ansible_facts
|
||
|
- "'uuid' in ansible_local"
|
||
|
|
||
|
- name: cleanup 'local facts' from target
|
||
|
file: path=/etc/ansible/facts.d/uuid.fact state=absent
|