1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/tests/integration/targets/inventory_docker_swarm/runme.sh
Sam Doran f585aa065a
inventory_docker_swarm test - Remove exit code from trap (#391)
Setting the exit code in a trap overrides the exit code that caused the
trap to be called. This means if the test failed and called the trap,
the test will exit with 0 rather than the failure exit code.
2020-05-21 21:48:41 +02:00

22 lines
534 B
Bash
Executable file

#!/usr/bin/env bash
[[ -n "$DEBUG" || -n "$ANSIBLE_DEBUG" ]] && set -x
set -euo pipefail
cleanup() {
echo "Cleanup"
ansible-playbook playbooks/swarm_cleanup.yml
echo "Done"
}
trap cleanup INT TERM EXIT
echo "Setup"
ANSIBLE_ROLES_PATH=.. ansible-playbook playbooks/swarm_setup.yml
echo "Test docker_swarm inventory 1"
ansible-playbook -i inventory_1.docker_swarm.yml playbooks/test_inventory_1.yml
echo "Test docker_swarm inventory 2"
ansible-playbook -i inventory_2.docker_swarm.yml playbooks/test_inventory_2.yml