summaryrefslogtreecommitdiffstats
path: root/examples/playbooks/command-check-success.yml
blob: 2a8e43dd509885c054f1e88b2759eae52237cdd8 (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
---
- name: Fixture for no-changed-when
  hosts: localhost
  tasks:
    - name: Command with creates check
      ansible.builtin.command: echo blah
      args:
        creates: Z

    - name: Command with removes check
      ansible.builtin.command: echo blah
      args:
        removes: Z

    - name: Command with changed_when
      ansible.builtin.command: echo blah
      changed_when: false

    - name: Command with inline creates # noqa: no-free-form
      ansible.builtin.command: creates=Z echo blah

    - name: Command with inline removes # noqa: no-free-form
      ansible.builtin.command: removes=Z echo blah

    - name: Command with cmd # noqa: fqcn[action-core]
      command:
        cmd: echo blah
      args:
        creates: Z

    - name: Use shell with creates check # noqa: fqcn[action-core] command-instead-of-shell
      shell: echo blah
      args:
        creates: Z

    - name: Use shell with removes check # noqa: fqcn[action-core] command-instead-of-shell
      shell: echo blah
      args:
        removes: Z

    - name: Use shell with changed_when # noqa: fqcn[action-core] command-instead-of-shell
      shell: echo blah
      changed_when: false

    - name: Use shell with inline creates # noqa: fqcn[action-core] no-free-form command-instead-of-shell
      shell: creates=Z echo blah

    - name: Use shell with inline removes # noqa: fqcn[action-core] no-free-form command-instead-of-shell
      shell: removes=Z echo blah

    - name: Use shell with cmd # noqa: fqcn[action-core] command-instead-of-shell
      shell:
        cmd: echo blah
      args:
        creates: Z

- name: Fixture
  hosts: localhost
  handlers:
    - name: Restart something # noqa: fqcn[action-core] no-changed-when
      command: do something
    - name: Foo # noqa: fqcn[action-core] deprecated-module
      include: handlers/included-handlers.yml