Protect CLI parameters passed through osa wrapper

Co-Author: Adrien Cunin <adrien.cunin@osones.com>
Change-Id: I75a48a23bd94f04ce14af587574af4901056a50f
This commit is contained in:
Hugh Saunders 2016-11-04 16:05:16 +00:00 committed by Jesse Pretorius (odyssey4me)
parent 3b8601fdaa
commit a7269d37f9
2 changed files with 5 additions and 5 deletions

View File

@ -198,7 +198,7 @@ fi
# Execute the Ansible command.
if [ "\${RUN_CMD}" == "openstack-ansible" ] || [ "\${RUN_CMD}" == "ansible-playbook" ]; then
/opt/ansible-runtime/bin/ansible-playbook \${@} \${VAR1}
/opt/ansible-runtime/bin/ansible-playbook "\${@}" \${VAR1}
else
/opt/ansible-runtime/bin/\${RUN_CMD} "\${@}"
fi

View File

@ -18,7 +18,7 @@
## Vars ----------------------------------------------------------------------
LINE='----------------------------------------------------------------------'
MAX_RETRIES=${MAX_RETRIES:-5}
ANSIBLE_PARAMETERS=${ANSIBLE_PARAMETERS:-" -e 'gather_facts=False' "}
ANSIBLE_PARAMETERS=${ANSIBLE_PARAMETERS:--e gather_facts=False}
STARTTIME="${STARTTIME:-$(date +%s)}"
PIP_INSTALL_OPTIONS=${PIP_INSTALL_OPTIONS:-'pip==8.1.2 setuptools==28.3.0 wheel==0.29.0 '}
COMMAND_LOGS=${COMMAND_LOGS:-"/openstack/log/ansible_cmd_logs"}
@ -59,9 +59,9 @@ function successerator {
false
for ((RETRY=0; $? != 0 && RETRY < MAX_RETRIES; RETRY++)); do
if [ ${RETRY} -gt 1 ];then
$@ -vvvv
"$@" -vvvv
else
$@
"$@"
fi
done
# If max retires were hit, fail.
@ -82,7 +82,7 @@ function successerator {
function install_bits {
# Use the successerator to run openstack-ansible
successerator openstack-ansible $@ ${ANSIBLE_PARAMETERS}
successerator openstack-ansible "$@" ${ANSIBLE_PARAMETERS}
}
function ssh_key_create {