kayobe/tools/test-ansible.sh
Pierre Riteau 225130a594 Use {{ openstack_branch }} as version of kolla-ansible in ansible tests
Instead of always checking out the master branch, use the kolla-ansible
branch with which this Kayobe version is meant to be used.

Change-Id: I074d4b9d444649ecf956d3cd92748862e8c89a5c
2019-12-06 17:29:45 +01:00

22 lines
703 B
Bash
Executable File

#!/bin/bash
# Run ansible tests. Any arguments passed to this script will be passed onto
# ansible-playbook.
set -e
failed=0
for playbook in ansible/roles/*/tests/main.yml; do
# We declare extra variables to install the {{ openstack_branch }} version
# of kolla-ansible. We should use {{ kolla_ansible_source_version }}, but
# adding ansible/group_vars/all/kolla would in turn require other
# extra-vars files (like pip) and may cause unintended side effects.
if ! ansible-playbook --connection=local $playbook $* -e @ansible/group_vars/all/openstack; then
failed=$((failed + 1))
fi
done
if [[ $failed -ne 0 ]]; then
echo "Failed $failed test cases"
exit 1
fi