blob: 7df9224403a8563e423643ff7860d2434a25ec65 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
---
- 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 == 'foobar_from_set_fact_cacheable'
- 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
- 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
- name: show ansible_foobar_fqcn fact (FQCN)
debug:
var: ansible_foobar_fqcn
- name: assert ansible_foobar_fqcn is correct value when read from cache (FQCN)
assert:
that:
- ansible_foobar_fqcn == 'foobar_fqcn_from_set_fact_cacheable'
- name: show ansible_foobar_fqcn_not_cached fact (FQCN)
debug:
var: ansible_foobar_fqcn_not_cached
- name: assert ansible_foobar_fqcn_not_cached is not cached (FQCN)
assert:
that:
- ansible_foobar_fqcn_not_cached is undefined
- name: show fact_not_cached_fqcn fact (FQCN)
debug:
var: fact_not_cached_fqcn
- name: assert fact_not_cached_fqcn is not cached (FQCN)
assert:
that:
- fact_not_cached_fqcn is undefined
|