summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/no_log/no_log_local.yml
blob: bf02468f2245f6f41a0e6d107bdc1651a0753088 (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
61
62
63
64
65
# TODO: test against real connection plugins to ensure they're not leaking module args

- name: normal play
  hosts: testhost
  gather_facts: no
  tasks:
    - name: args should be logged in the absence of no_log
      shell: echo "LOG_ME_TASK_SUCCEEDED"

    - name: failed args should be logged in the absence of no_log
      shell: echo "LOG_ME_TASK_FAILED"
      failed_when: true
      ignore_errors: true

    - name: item args should be logged in the absence of no_log
      shell: echo {{ item }}
      with_items: [ "LOG_ME_ITEM", "LOG_ME_SKIPPED", "LOG_ME_ITEM_FAILED" ]
      when: item != "LOG_ME_SKIPPED"
      failed_when: item == "LOG_ME_ITEM_FAILED"
      ignore_errors: true

    - name: args should not be logged when task-level no_log set
      shell: echo "DO_NOT_LOG_TASK_SUCCEEDED"
      no_log: true

    - name: failed args should not be logged when task-level no_log set
      shell: echo "DO_NOT_LOG_TASK_FAILED"
      no_log: true
      failed_when: true
      ignore_errors: true

    - name: skipped task args should be suppressed with no_log
      shell: echo "DO_NOT_LOG_TASK_SKIPPED"
      no_log: true
      when: false

    - name: items args should be suppressed with no_log in every state
      shell: echo {{ item }}
      no_log: true
      with_items: [ "DO_NOT_LOG_ITEM", "DO_NOT_LOG_ITEM_SKIPPED", "DO_NOT_LOG_ITEM_FAILED" ]
      when: item != "DO_NOT_LOG_ITEM_SKIPPED"
      failed_when: item == "DO_NOT_LOG_ITEM_FAILED"
      ignore_errors: yes

    - name: async task args should suppressed with no_log
      async: 10
      poll: 1
      shell: echo "DO_NOT_LOG_ASYNC_TASK_SUCCEEDED"
      no_log: true

- name: play-level no_log set
  hosts: testhost
  gather_facts: no
  no_log: true
  tasks:
      - name: args should not be logged when play-level no_log set
        shell: echo "DO_NOT_LOG_PLAY"

      - name: args should not be logged when both play- and task-level no_log set
        shell: echo "DO_NOT_LOG_TASK_AND_PLAY"
        no_log: true

      - name: args should be logged when task-level no_log overrides play-level
        shell: echo "LOG_ME_OVERRIDE"
        no_log: false