Skip to content

Instantly share code, notes, and snippets.

@evrardjp
Last active May 6, 2016 10:39
Show Gist options
  • Save evrardjp/41db06752bb2d9ad54b0740b29527c7b to your computer and use it in GitHub Desktop.
Save evrardjp/41db06752bb2d9ad54b0740b29527c7b to your computer and use it in GitHub Desktop.
CI testing for ansible roles
apt-get update -qq
apt-get install -qq git git-core python2.7 python-dev python-apt python-pycurl libyaml-dev libpython2.7-dev build-essential libssl-dev libffi-dev
ansible-playbook test.yml --connection=local --syntax-check -i 127.0.0.1,
ansible-playbook test.yml --connection=local --sudo -i 127.0.0.1,
ansible-playbook test.yml --connection=local --sudo -i 127.0.0.1, | tee /tmp/output.txt; grep -q 'changed=0.*failed=0' /tmp/output.txt && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment