summaryrefslogtreecommitdiff
path: root/lib/ansible/plugins/action/shell.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ansible/plugins/action/shell.py')
-rw-r--r--lib/ansible/plugins/action/shell.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ansible/plugins/action/shell.py b/lib/ansible/plugins/action/shell.py
index 617a373d..dd4df461 100644
--- a/lib/ansible/plugins/action/shell.py
+++ b/lib/ansible/plugins/action/shell.py
@@ -4,6 +4,7 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
+from ansible.errors import AnsibleActionFail
from ansible.plugins.action import ActionBase
@@ -15,6 +16,11 @@ class ActionModule(ActionBase):
# Shell module is implemented via command with a special arg
self._task.args['_uses_shell'] = True
+ # Shell shares the same module code as command. Fail if command
+ # specific options are set.
+ if "expand_argument_vars" in self._task.args:
+ raise AnsibleActionFail(f"Unsupported parameters for ({self._task.action}) module: expand_argument_vars")
+
command_action = self._shared_loader_obj.action_loader.get('ansible.legacy.command',
task=self._task,
connection=self._connection,