summaryrefslogtreecommitdiffstats
path: root/examples/playbooks/rule-command-instead-of-shell-pass.yml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:06:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 12:06:49 +0000
commit2fe34b6444502079dc0b84365ce82dbc92de308e (patch)
tree8fedcab52bbbc3db6c5aa909a88a7a7b81685018 /examples/playbooks/rule-command-instead-of-shell-pass.yml
parentInitial commit. (diff)
downloadansible-lint-1f847810e1dcffeab102ff853e50a09833fad025.tar.xz
ansible-lint-1f847810e1dcffeab102ff853e50a09833fad025.zip
Adding upstream version 6.17.2.upstream/6.17.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'examples/playbooks/rule-command-instead-of-shell-pass.yml')
-rw-r--r--examples/playbooks/rule-command-instead-of-shell-pass.yml60
1 files changed, 60 insertions, 0 deletions
diff --git a/examples/playbooks/rule-command-instead-of-shell-pass.yml b/examples/playbooks/rule-command-instead-of-shell-pass.yml
new file mode 100644
index 0000000..8bbaef3
--- /dev/null
+++ b/examples/playbooks/rule-command-instead-of-shell-pass.yml
@@ -0,0 +1,60 @@
+---
+- name: Fixture
+ hosts: localhost
+ tasks:
+ - name: Shell with pipe
+ ansible.builtin.shell:
+ cmd: echo hello | true # noqa: risky-shell-pipe
+ changed_when: false
+
+ - name: Shell with redirect
+ ansible.builtin.shell:
+ cmd: echo hello > /tmp/hello
+ changed_when: false
+
+ - name: Chain two shell commands
+ ansible.builtin.shell:
+ cmd: echo hello && echo goodbye
+ changed_when: false
+
+ - name: Run commands in succession
+ ansible.builtin.shell:
+ cmd: echo hello ; echo goodbye
+ changed_when: false
+
+ - name: Use variables
+ ansible.builtin.shell:
+ cmd: echo $HOME $USER
+ changed_when: false
+
+ - name: Use * for globbing
+ ansible.builtin.shell:
+ cmd: ls foo*
+ changed_when: false
+
+ - name: Use ? for globbing
+ ansible.builtin.shell:
+ cmd: ls foo?
+ changed_when: false
+
+ - name: Use [] for globbing
+ ansible.builtin.shell:
+ cmd: ls foo[1,2,3]
+ changed_when: false
+
+ - name: Use shell generator
+ ansible.builtin.shell:
+ cmd: ls foo{.txt,.xml}
+ changed_when: false
+
+ - name: Use backticks
+ ansible.builtin.shell:
+ cmd: ls `ls foo*`
+ changed_when: false
+
+ - name: Use shell with cmd
+ ansible.builtin.shell:
+ cmd: |
+ set -x
+ ls foo?
+ changed_when: false