Merge pull request #2006 from ryanpetrello/port-jinja2-always

allow Jinja2 in ansible -a when ALLOW_JINJA_IN_EXTRA_VARS is 'always'
This commit is contained in:
Ryan Petrello 2018-06-01 07:32:48 -04:00 committed by GitHub
commit 8c5f3404bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2269,7 +2269,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)