mirror of
https://github.com/willshersystems/ansible-sshd
synced 2024-12-01 07:00:17 +01:00
29 lines
868 B
YAML
29 lines
868 B
YAML
---
|
|
language: c
|
|
sudo: required
|
|
|
|
notifications:
|
|
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
|
|
|
before_install:
|
|
- sudo add-apt-repository -y ppa:ansible/ansible
|
|
- sudo apt-get update -qq
|
|
- sudo apt-get -qq install ansible
|
|
|
|
install:
|
|
# Add ansible.cfg to pick up roles path.
|
|
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
|
|
|
|
script:
|
|
# Check the roles syntax
|
|
- "ansible-playbook -i tests/inventory tests/test.yml --syntax-check"
|
|
|
|
# Run the role
|
|
- "ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo"
|
|
|
|
# Run the role/playbook again, checking to make sure it's idempotent.
|
|
- >
|
|
ansible-playbook -i tests/inventory tests/test.yml --connection=local --sudo
|
|
| grep -q 'changed=0.*failed=0'
|
|
&& (echo 'Idempotence test: pass' && exit 0)
|
|
|| (echo 'Idempotence test: fail' && exit 1)
|