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 <mchandras@suse.de>
This commit is contained in:
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user