From 980bbcb414ec6ae190f53612415d212dc1ad57fa Mon Sep 17 00:00:00 2001 From: Allen Gao Date: Wed, 20 Jan 2016 22:12:42 +0800 Subject: [PATCH] kolla-ansible: refactor the command options TrivialFix Change-Id: I511f463250d1472c831aa3e5b126dafb36ce79c4 --- tools/kolla-ansible | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/kolla-ansible b/tools/kolla-ansible index b2130ffb0e..7f81ed950a 100755 --- a/tools/kolla-ansible +++ b/tools/kolla-ansible @@ -79,29 +79,29 @@ while [ "$#" -gt 0 ]; do esac done +EXTRA_OPTS="-e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml" + case "$1" in (prechecks) ACTION="Pre-deployment checking" PLAYBOOK="${BASEDIR}/ansible/prechecks.yml" - CMD="ansible-playbook -i $INVENTORY -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml $PLAYBOOK" ;; (deploy) ACTION="Deploying Playbooks" - CMD="ansible-playbook -i $INVENTORY -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml $PLAYBOOK -e action=deploy" + EXTRA_OPTS="$EXTRA_OPTS -e action=deploy" ;; (post-deploy) ACTION="Post-Deploying Playbooks" PLAYBOOK="${BASEDIR}/ansible/post-deploy.yml" - CMD="ansible-playbook -i $INVENTORY -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml $PLAYBOOK" ;; (pull) ACTION="Pulling Docker images" - CMD="ansible-playbook -i $INVENTORY -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml $PLAYBOOK -e action=pull" + EXTRA_OPTS="$EXTRA_OPTS -e action=pull" ;; (upgrade) ACTION="Upgrading OpenStack Environment" - CMD="ansible-playbook -i $INVENTORY -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml $PLAYBOOK -e action=upgrade" + EXTRA_OPTS="$EXTRA_OPTS -e action=upgrade" ;; (*) usage @@ -109,4 +109,5 @@ case "$1" in ;; esac +CMD="ansible-playbook -i $INVENTORY $EXTRA_OPTS $PLAYBOOK" process_cmd