1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

allow Jinja2 in ansible -a when ALLOW_JINJA_IN_EXTRA_VARS is 'always'

This commit is contained in:
Ryan Petrello 2018-04-20 16:32:18 -04:00
parent 246e63bdb6
commit 99d2f3ea34

View File

@ -2266,7 +2266,10 @@ class RunAdHocCommand(BaseTask):
args.extend(['-e', '@%s' % (extra_vars_path)])
args.extend(['-m', ad_hoc_command.module_name])
args.extend(['-a', sanitize_jinja(ad_hoc_command.module_args)])
module_args = ad_hoc_command.module_args
if settings.ALLOW_JINJA_IN_EXTRA_VARS != 'always':
module_args = sanitize_jinja(module_args)
args.extend(['-a', module_args])
if ad_hoc_command.limit:
args.append(ad_hoc_command.limit)