2015-01-12 22:01:08 +01:00
|
|
|
---
|
2020-09-18 21:48:56 +02:00
|
|
|
dist: focal
|
2015-01-15 11:06:52 +01:00
|
|
|
language: c
|
2016-01-24 17:03:08 +01:00
|
|
|
sudo: required
|
2015-01-12 22:01:08 +01:00
|
|
|
|
2016-02-18 14:42:50 +01:00
|
|
|
notifications:
|
2020-09-18 21:48:56 +02:00
|
|
|
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
2016-02-18 14:42:50 +01:00
|
|
|
|
2015-01-12 22:01:08 +01:00
|
|
|
before_install:
|
2020-09-18 21:48:56 +02:00
|
|
|
- sudo -H pip3 install ansible
|
2015-01-12 22:01:08 +01:00
|
|
|
|
|
|
|
install:
|
|
|
|
# Add ansible.cfg to pick up roles path.
|
2020-09-18 21:48:56 +02:00
|
|
|
- "{ echo '[defaults]'; echo 'roles_path = ../'; echo 'deprecation_warnings=False'; } >> ansible.cfg"
|
2015-01-12 22:12:32 +01:00
|
|
|
|
2015-01-12 22:01:08 +01:00
|
|
|
script:
|
2018-08-10 20:17:36 +02:00
|
|
|
# Check the roles syntax.
|
2020-09-17 14:48:41 +02:00
|
|
|
- "ANSIBLE_FORCE_COLOR=1 ansible-playbook -i tests/inventory tests/test_default.yml --syntax-check"
|
2015-01-12 22:01:08 +01:00
|
|
|
|
2015-01-12 22:12:32 +01:00
|
|
|
# Run the role
|
2020-09-17 14:48:41 +02:00
|
|
|
- "ANSIBLE_FORCE_COLOR=1 ansible-playbook -i tests/inventory tests/test_default.yml --connection=local --become -v"
|
2015-01-12 22:01:08 +01:00
|
|
|
|
2015-01-12 22:12:32 +01:00
|
|
|
# Run the role/playbook again, checking to make sure it's idempotent.
|
|
|
|
- >
|
2020-09-17 14:48:41 +02:00
|
|
|
ansible-playbook -i tests/inventory tests/test_default.yml --connection=local --become | grep -q 'changed=0.*failed=0'
|
2015-01-12 22:12:32 +01:00
|
|
|
&& (echo 'Idempotence test: pass' && exit 0)
|
|
|
|
|| (echo 'Idempotence test: fail' && exit 1)
|