mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
6fbd0a8bb5
* Add 'cacheable' param to set_fact action and module. Used just like set_fact, except facts set with cacheable: true will be stored in the fact cache if fact caching is enabled. set_fact normally only sets facts in the non_persistent_fact_cache, so they are lost between invocations. * update set_facts docs * use 'ansible_facts_cacheable' in module/actions result * pop fact cacheable related items out of args/results We dont want to use 'ansible_facts_cacheable' result item or 'cacheable' arg as actual facts, so pop them out of the dicts.
21 lines
546 B
YAML
21 lines
546 B
YAML
---
|
|
- 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:
|
|
- ansible_foobar == 'blippy'
|
|
|
|
- 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
|