ansible-sshd/.travis.yml

36 lines
1.1 KiB
YAML
Raw Normal View History

2015-01-12 22:01:08 +01:00
---
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:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
2015-01-12 22:01:08 +01:00
before_install:
2015-01-15 11:06:52 +01:00
- sudo add-apt-repository -y ppa:ansible/ansible
2015-01-12 22:01:08 +01:00
- sudo apt-get update -qq
2015-01-15 11:06:52 +01:00
- sudo apt-get -qq install ansible
2015-01-12 22:01:08 +01:00
install:
# Add ansible.cfg to pick up roles path.
2015-01-12 22:12:32 +01:00
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
2015-01-12 22:01:08 +01:00
script:
# Check the ansible version.
- >
ansible --version
| grep -q '^ansible 2'
&& (echo 'Ansible 2.0+ test: pass' && exit 0)
|| (echo 'Ansible 2.0+ test: fail' && exit 1)
# Check the roles syntax.
2018-08-10 19:56:24 +02:00
- "ANSIBLE_FORCE_COLOR=1 ansible-playbook -i tests/inventory tests/test.yml --syntax-check"
2015-01-12 22:01:08 +01:00
2015-01-12 22:12:32 +01:00
# Run the role
2019-05-23 21:34:28 +02:00
- "ANSIBLE_FORCE_COLOR=1 ansible-playbook -i tests/inventory tests/test.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.
- >
2019-05-23 21:34:28 +02:00
ansible-playbook -i tests/inventory tests/test.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)
2019-05-23 21:34:28 +02:00