File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ The return status of a pipeline is the exit status of the command. The
7
7
` pipefail ` option ensures that tasks fail as expected if the first command
8
8
fails.
9
9
10
+ This does not work in the standard (POSIX) shell. You will need to set the executable
11
+ to a different shell, such as bash. See the example below.
12
+
10
13
As this requirement does not apply to PowerShell, for shell commands that have
11
14
` pwsh ` inside ` executable ` attribute, this rule will not trigger.
12
15
Original file line number Diff line number Diff line change 15
15
16
16
17
17
class ShellWithoutPipefail (AnsibleLintRule ):
18
- """Shells that use pipes should set the pipefail option."""
18
+ """Shells that use pipes should set the pipefail option. NB: This requires changing the shell, see the docs. """
19
19
20
20
id = "risky-shell-pipe"
21
21
description = (
@@ -24,7 +24,8 @@ class ShellWithoutPipefail(AnsibleLintRule):
24
24
"any part of the pipeline other than the terminal command "
25
25
"fails, the whole pipeline will still return 0, which may "
26
26
"be considered a success by Ansible. "
27
- "Pipefail is available in the bash shell."
27
+ "Pipefail is not available in the default (POSIX) shell, "
28
+ "consider bash."
28
29
)
29
30
severity = "MEDIUM"
30
31
tags = ["command-shell" ]
You can’t perform that action at this time.
0 commit comments