Merge pull request #49966 from thebluesnevrdie/ansible-playbook-extra-vars-fix

Fix quoting issue when passing extra_vars to ansible-playbook
This commit is contained in:
Nicole Thomas 2018-10-10 10:08:27 -04:00 committed by GitHub
commit 16ed58ae3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -333,7 +333,7 @@ def playbooks(playbook, rundir=None, check=False, diff=False, extra_vars=None,
if diff: if diff:
command.append('--diff') command.append('--diff')
if isinstance(extra_vars, dict): if isinstance(extra_vars, dict):
command.append('--extra-vars={0}'.format(json.dumps(extra_vars))) command.append("--extra-vars='{0}'".format(json.dumps(extra_vars)))
elif isinstance(extra_vars, six.text_type) and extra_vars.startswith('@'): elif isinstance(extra_vars, six.text_type) and extra_vars.startswith('@'):
command.append('--extra-vars={0}'.format(extra_vars)) command.append('--extra-vars={0}'.format(extra_vars))
if flush_cache: if flush_cache: