summaryrefslogtreecommitdiff
path: root/test/integration/targets/roles/privacy.yml
blob: 2f671c07078d245ade27e33cde23926b069ca608 (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
58
59
60
# use this to debug issues
#- debug: msg={{ is_private ~ ', ' ~ is_default ~ ', ' ~ privacy|default('nope')}}

- hosts: localhost
  name: test global privacy setting
  gather_facts: false
  roles:
    - a
  pre_tasks:

    - name: 'test roles: privacy'
      assert:
        that:
          - is_private and privacy is undefined or not is_private and privacy is defined
          - not is_default or is_default and privacy is defined

- hosts: localhost
  name: test import_role privacy
  gather_facts: false
  tasks:
    - import_role: name=a

    - name: role is private, var should be undefined
      assert:
        that:
          - is_private and privacy is undefined or not is_private and privacy is defined
          - not is_default or is_default and privacy is defined

- hosts: localhost
  name: test global privacy setting on includes
  gather_facts: false
  tasks:
    - include_role: name=a

    - name: test include_role privacy
      assert:
        that:
          - 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

- hosts: localhost
  name: test public yes always overrides global privacy setting on includes
  gather_facts: false
  tasks:
    - include_role: name=a public=yes

    - name: test include_role privacy
      assert:
        that:
          - privacy is defined

- hosts: localhost
  name: test public no always overrides global privacy setting on includes
  gather_facts: false
  tasks:
    - include_role: name=a public=no

    - name: test include_role privacy
      assert:
        that:
          - privacy is undefined