Debian Codegraph @

test/integration/targets/roles/privacy.yml

raw
1 # use this to debug issues
2 #- debug: msg={{ is_private ~ ', ' ~ is_default ~ ', ' ~ privacy|default('nope')}}
3
4 - hosts: localhost
5 name: test global privacy setting
6 gather_facts: false
7 roles:
8 - a
9 pre_tasks:
10
11 - name: 'test roles: privacy'
12 assert:
13 that:
14 - is_private and privacy is undefined or not is_private and privacy is defined
15 - not is_default or is_default and privacy is defined
16
17 - hosts: localhost
18 name: test import_role privacy
19 gather_facts: false
20 tasks:
21 - import_role: name=a
22
23 - name: role is private, var should be undefined
24 assert:
25 that:
26 - is_private and privacy is undefined or not is_private and privacy is defined
27 - not is_default or is_default and privacy is defined
28
29 - hosts: localhost
30 name: test public no always overrides global on import_role
31 gather_facts: false
32 tasks:
33 - import_role: name=a public=no
34
35 - name: role is private, var should be undefined
36 assert:
37 that:
38 - privacy is undefined
39
40 - hosts: localhost
41 name: test public yes always overrides global on import_role
42 gather_facts: false
43 tasks:
44 - import_role: name=a public=yes
45
46 - name: role is private, var should be undefined
47 assert:
48 that:
49 - privacy is defined
50
51 - hosts: localhost
52 name: test global privacy setting on includes
53 gather_facts: false
54 tasks:
55 - include_role: name=a
56
57 - name: test include_role privacy
58 assert:
59 that:
60 - not is_default and (is_private and privacy is undefined or not is_private and privacy is defined) or is_default and privacy is undefined
61
62 - hosts: localhost
63 name: test public yes always overrides global privacy setting on includes
64 gather_facts: false
65 tasks:
66 - include_role: name=a public=yes
67
68 - name: test include_role privacy
69 assert:
70 that:
71 - privacy is defined
72
73 - hosts: localhost
74 name: test public no always overrides global privacy setting on includes
75 gather_facts: false
76 tasks:
77 - include_role: name=a public=no
78
79 - name: test include_role privacy
80 assert:
81 that:
82 - privacy is undefined