2017-08-02 21:57:58 +02:00
|
|
|
---
|
|
|
|
- name: A second playbook run with fact caching enabled
|
|
|
|
hosts: localhost
|
|
|
|
tasks:
|
|
|
|
- name: show ansible_foobar fact
|
|
|
|
debug:
|
|
|
|
var: ansible_foobar
|
|
|
|
|
|
|
|
- name: assert ansible_foobar is correct value when read from cache
|
|
|
|
assert:
|
|
|
|
that:
|
2017-12-20 05:34:05 +01:00
|
|
|
- ansible_foobar == 'foobar_from_set_fact_cacheable'
|
2017-08-02 21:57:58 +02:00
|
|
|
|
|
|
|
- name: show ansible_foobar_not_cached fact
|
|
|
|
debug:
|
|
|
|
var: ansible_foobar_not_cached
|
|
|
|
|
|
|
|
- name: assert ansible_foobar_not_cached is not cached
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- ansible_foobar_not_cached is undefined
|
2018-01-15 17:02:24 +01:00
|
|
|
|
|
|
|
- name: show fact_not_cached fact
|
|
|
|
debug:
|
|
|
|
var: fact_not_cached
|
|
|
|
|
|
|
|
- name: assert fact_not_cached is not cached
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- fact_not_cached is undefined
|