From 101551ae8dd34bc2e225cc7abba45a831f7d0c71 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Mon, 22 Aug 2016 10:55:08 +0300 Subject: [PATCH] Split --syntax-check and --list-tasks steps in test-bifrost.sh ansible-playbook's --syntax-check and --list-tasks can't be used together because --syntax-check makes ansible-playbook to exit right after it checks the playbook file so the list of tasks is never reported. For example: [...] + /opt/stack/ansible/bin/ansible-playbook -vvvv -i inventory/localhost test-bifrost-create-vm.yaml --syntax-check --list-tasks No config file found; using defaults 1 plays in test-bifrost-create-vm.yaml playbook: test-bifrost-create-vm.yaml + /opt/stack/ansible/bin/ansible-playbook -vvvv -i inventory/localhost test-bifrost.yaml --syntax-check --list-tasks -e testing_user=cirros No config file found; using defaults 9 plays in test-bifrost.yaml playbook: test-bifrost.yaml [...] As a result of which, split these two steps in order for both operations to be executed as expected. Change-Id: I053dbb72c95ddb7bb3ba5063317c03dc31d98e31 Signed-off-by: Markos Chandras --- scripts/test-bifrost.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/test-bifrost.sh b/scripts/test-bifrost.sh index 728badd40..7c752975a 100755 --- a/scripts/test-bifrost.sh +++ b/scripts/test-bifrost.sh @@ -89,17 +89,17 @@ fi cd $BIFROST_HOME/playbooks # Syntax check of dynamic inventory test path -${ANSIBLE} -vvvv \ - -i inventory/localhost \ - test-bifrost-create-vm.yaml \ - --syntax-check \ - --list-tasks -${ANSIBLE} -vvvv \ - -i inventory/localhost \ - ${TEST_PLAYBOOK} \ - --syntax-check \ - --list-tasks \ - -e testing_user=${TESTING_USER} +for task in syntax-check list-tasks; do + ${ANSIBLE} -vvvv \ + -i inventory/localhost \ + test-bifrost-create-vm.yaml \ + --${task} + ${ANSIBLE} -vvvv \ + -i inventory/localhost \ + ${TEST_PLAYBOOK} \ + --${task} \ + -e testing_user=${TESTING_USER} +done # Create the test VM ${ANSIBLE} -vvvv \