mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2024-11-14 17:30:19 +01:00
18 lines
537 B
Bash
Executable file
18 lines
537 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Idempotency test for Ansible
|
|
#
|
|
# Runs an Ansible role/playbook, and makes sure no changes were made.
|
|
#
|
|
# @author Jeff Geerling, 2014
|
|
|
|
# Change directory up one level (into project root).
|
|
cd ../
|
|
|
|
# Run playbook, and exit with 0 status if 'changed=0' found (good).
|
|
pwd
|
|
echo "ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo"
|
|
ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo | grep -q 'changed=0' && exit 0
|
|
|
|
# Exit with a non-zero status if 'changed=0' was not found.
|
|
exit 1
|