Skip to content

Commit

Permalink
Accept shell when executable is set (#2176)
Browse files Browse the repository at this point in the history
Co-authored-by: Sorin Sbarnea <[email protected]>
  • Loading branch information
nkakouros and ssbarnea authored May 25, 2022
1 parent e6126f2 commit 951a828
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ansiblelint/rules/command_instead_of_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ def matchtask(
# Use unjinja so that we don't match on jinja filters
# rather than pipes
if task["action"]["__ansible_module__"] in ["shell", "ansible.builtin.shell"]:
# Since Ansible 2.4, the `command` module does not accept setting
# the `executable`. If the user needs to set it, they have to use
# the `shell` module.
if "executable" in task["action"]:
return False

if "cmd" in task["action"]:
jinja_stripped_cmd = self.unjinja(task["action"].get("cmd", []))
else:
Expand Down

0 comments on commit 951a828

Please sign in to comment.