Use become not sudo

This commit is contained in:
Matt Willsher 2019-05-23 20:34:28 +01:00
parent a141241d1a
commit 7b5e905a20

View file

@ -25,11 +25,11 @@ script:
- "ANSIBLE_FORCE_COLOR=1 ansible-playbook -i tests/inventory tests/test.yml --syntax-check" - "ANSIBLE_FORCE_COLOR=1 ansible-playbook -i tests/inventory tests/test.yml --syntax-check"
# Run the role # Run the role
- "ANSIBLE_FORCE_COLOR=1 ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo -v" - "ANSIBLE_FORCE_COLOR=1 ansible-playbook -i tests/inventory tests/test.yml --connection=local --become -v"
# Run the role/playbook again, checking to make sure it's idempotent. # Run the role/playbook again, checking to make sure it's idempotent.
- > - >
ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo ansible-playbook -i tests/inventory tests/test.yml --connection=local --become | grep -q 'changed=0.*failed=0'
| grep -q 'changed=0.*failed=0'
&& (echo 'Idempotence test: pass' && exit 0) && (echo 'Idempotence test: pass' && exit 0)
|| (echo 'Idempotence test: fail' && exit 1) || (echo 'Idempotence test: fail' && exit 1)