summaryrefslogtreecommitdiffstats
path: root/src/ansiblelint/rules/risky_shell_pipe.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 06:24:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-26 06:24:58 +0000
commitba233a0cbad76b4783a03893e7bf4716fbc0f0ec (patch)
treead369728c1edbe3631c8150585659078ae5d7d0b /src/ansiblelint/rules/risky_shell_pipe.md
parentReleasing progress-linux version 6.17.2-3~progress7.99u1. (diff)
downloadansible-lint-ba233a0cbad76b4783a03893e7bf4716fbc0f0ec.tar.xz
ansible-lint-ba233a0cbad76b4783a03893e7bf4716fbc0f0ec.zip
Merging upstream version 24.6.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/ansiblelint/rules/risky_shell_pipe.md')
-rw-r--r--src/ansiblelint/rules/risky_shell_pipe.md14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/ansiblelint/rules/risky_shell_pipe.md b/src/ansiblelint/rules/risky_shell_pipe.md
index 302d0d9..dfede8e 100644
--- a/src/ansiblelint/rules/risky_shell_pipe.md
+++ b/src/ansiblelint/rules/risky_shell_pipe.md
@@ -7,7 +7,7 @@ The return status of a pipeline is the exit status of the command. The
`pipefail` option ensures that tasks fail as expected if the first command
fails.
-As this requirement does apply to PowerShell, for shell commands that have
+As this requirement does not apply to PowerShell, for shell commands that have
`pwsh` inside `executable` attribute, this rule will not trigger.
## Problematic Code
@@ -30,10 +30,14 @@ As this requirement does apply to PowerShell, for shell commands that have
become: false
tasks:
- name: Pipeline with pipefail
- ansible.builtin.shell: set -o pipefail && false | cat
+ ansible.builtin.shell:
+ cmd: set -o pipefail && false | cat
+ executable: /bin/bash
- name: Pipeline with pipefail, multi-line
- ansible.builtin.shell: |
- set -o pipefail # <-- adding this will prevent surprises
- false | cat
+ ansible.builtin.shell:
+ cmd: |
+ set -o pipefail # <-- adding this will prevent surprises
+ false | cat
+ executable: /bin/bash
```