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.
ansible/test/integration/targets/set_fact/set_fact_cached_1.yml

47 lines
1.1 KiB
YAML

---
- name: the first play
hosts: localhost
tasks:
- name: show foobar fact before
debug:
var: ansible_foobar
- name: set a persistent fact foobar
set_fact:
ansible_foobar: 'blippy'
cacheable: true
- name: show foobar fact after
debug:
var: ansible_foobar
- name: assert ansible_foobar is correct value
assert:
that:
- ansible_foobar == 'blippy'
- name: set a non persistent fact that will not be cached
set_fact:
ansible_foobar_not_cached: 'this_should_not_be_cached'
- name: show ansible_foobar_not_cached fact after being set
debug:
var: ansible_foobar_not_cached
- name: assert ansible_foobar_not_cached is correct value
assert:
that:
- ansible_foobar_not_cached == 'this_should_not_be_cached'
- name: the second play
hosts: localhost
tasks:
- name: show foobar fact after second play
debug:
var: ansible_foobar
- name: assert ansible_foobar is correct value
assert:
that:
- ansible_foobar == 'blippy'