mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-12-23 17:10:19 +01:00
27 lines
878 B
YAML
27 lines
878 B
YAML
---
|
|
dist: focal
|
|
language: c
|
|
sudo: required
|
|
|
|
notifications:
|
|
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
|
|
|
before_install:
|
|
- sudo -H pip3 install ansible
|
|
|
|
install:
|
|
# Add ansible.cfg to pick up roles path.
|
|
- "{ echo '[defaults]'; echo 'roles_path = ../'; echo 'deprecation_warnings=False'; } >> ansible.cfg"
|
|
|
|
script:
|
|
# Check the roles syntax.
|
|
- "ANSIBLE_FORCE_COLOR=1 ansible-playbook -i tests/inventory tests/test.yml --syntax-check"
|
|
|
|
# Run the role
|
|
- "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.
|
|
- >
|
|
ansible-playbook -i tests/inventory tests/test.yml --connection=local --become | grep -q 'changed=0.*failed=0'
|
|
&& (echo 'Idempotence test: pass' && exit 0)
|
|
|| (echo 'Idempotence test: fail' && exit 1)
|