summaryrefslogtreecommitdiffstats
path: root/examples/playbooks/command-check-success.yml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:56 +0000
commitd964cec5e6aa807b75c7a4e7cdc5f11e54b2eda2 (patch)
tree794bc3738a00b5e599f06d1f2f6d79048d87ff8e /examples/playbooks/command-check-success.yml
parentInitial commit. (diff)
downloadansible-lint-upstream.tar.xz
ansible-lint-upstream.zip
Adding upstream version 6.13.1.upstream/6.13.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'examples/playbooks/command-check-success.yml')
-rw-r--r--examples/playbooks/command-check-success.yml60
1 files changed, 60 insertions, 0 deletions
diff --git a/examples/playbooks/command-check-success.yml b/examples/playbooks/command-check-success.yml
new file mode 100644
index 0000000..b855b8a
--- /dev/null
+++ b/examples/playbooks/command-check-success.yml
@@ -0,0 +1,60 @@
+---
+- 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
+ ansible.builtin.command: creates=Z echo blah
+
+ - name: Command with inline removes
+ ansible.builtin.command: removes=Z echo blah
+
+ - name: Command with cmd
+ command:
+ cmd: echo blah
+ args:
+ creates: Z
+
+ - name: Use shell with creates check
+ shell: echo blah
+ args:
+ creates: Z
+
+ - name: Use shell with removes check
+ shell: echo blah
+ args:
+ removes: Z
+
+ - name: Use shell with changed_when
+ shell: echo blah
+ changed_when: false
+
+ - name: Use shell with inline creates
+ shell: creates=Z echo blah
+
+ - name: Use shell with inline removes
+ shell: removes=Z echo blah
+
+ - name: Use shell with cmd
+ shell:
+ cmd: echo blah
+ args:
+ creates: Z
+
+- hosts: localhost
+ handlers:
+ - name: Restart something
+ command: do something
+ - include: handlers/included-handlers.yml