unquote ev (#51560)

* unquote ev

* properly test for defined var
pull/51581/head
Brian Coca 5 years ago committed by GitHub
parent f27078df52
commit e010034151
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -224,7 +224,7 @@ class PullCLI(CLI):
context.CLIARGS['module_name'],
repo_opts, limit_opts)
for ev in context.CLIARGS['extra_vars']:
cmd += ' -e "%s"' % shlex_quote(ev)
cmd += ' -e %s' % shlex_quote(ev)
# Nap?
if context.CLIARGS['sleep']:
@ -259,7 +259,7 @@ class PullCLI(CLI):
cmd += " --vault-id=%s" % vault_id
for ev in context.CLIARGS['extra_vars']:
cmd += ' -e "%s"' % shlex_quote(ev)
cmd += ' -e %s' % shlex_quote(ev)
if context.CLIARGS['ask_sudo_pass'] or context.CLIARGS['ask_su_pass'] or context.CLIARGS['become_ask_pass']:
cmd += ' --ask-become-pass'
if context.CLIARGS['skip_tags']:

@ -11,3 +11,9 @@
failed_when: "'testhost1.example.com' == inventory_hostname"
- name: final task, has to be reached for the test to succeed
debug: msg="MAGICKEYWORD"
- name: check that extra vars are correclty passed
assert:
that:
- docker_registries_login is defined
tags: ['never', 'test_ev']

@ -51,6 +51,6 @@ PASSWORD='test'
USER=${USER:-'broken_docker'}
JSON_EXTRA_ARGS='{"docker_registries_login": [{ "docker_password": "'"${PASSWORD}"'", "docker_username": "'"${USER}"'", "docker_registry_url":"repository-manager.company.com:5001"}], "docker_registries_logout": [{ "docker_password": "'"${PASSWORD}"'", "docker_username": "'"${USER}"'", "docker_registry_url":"repository-manager.company.com:5001"}] }'
ANSIBLE_CONFIG='' ansible-pull -d "${pull_dir}" -U "${repo_dir}" -e "${JSON_EXTRA_ARGS}" "$@" | tee "${temp_log}"
ANSIBLE_CONFIG='' ansible-pull -d "${pull_dir}" -U "${repo_dir}" -e "${JSON_EXTRA_ARGS}" "$@" --tags untagged,test_ev | tee "${temp_log}"
pass_tests

Loading…
Cancel
Save