During initial argument evaluation, cast args to string. (#17595)

Later in the stack, further code will check and inform the user that var names must start with a letter
or underscore, so this fix only allows us to get to that previously existing policy.

Fixes #16008
pull/17599/head
jctanner 8 years ago committed by GitHub
parent 2c54a8471f
commit b93de25204

@ -22,6 +22,7 @@ __metaclass__ = type
from ansible.compat.six import iteritems, string_types
from ansible.errors import AnsibleParserError,AnsibleError
from ansible.module_utils._text import to_text
from ansible.plugins import module_loader
from ansible.parsing.splitter import parse_kv, split_args
from ansible.template import Templar
@ -165,6 +166,7 @@ class ModuleArgsParser:
# we don't allow users to set them directy in arguments
if args and action not in ('command', 'win_command', 'shell', 'win_shell', 'script', 'raw'):
for arg in args:
arg = to_text(arg)
if arg.startswith('_ansible_'):
raise AnsibleError("invalid parameter specified for action '%s': '%s'" % (action, arg))

Loading…
Cancel
Save