forked from juju4/ansible-adduser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml.simple
34 lines (27 loc) · 1.22 KB
/
.travis.yml.simple
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
dist: xenial
language: python
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq python-apt python-pycurl
- "[ -f get-dependencies.sh ] && sh -x get-dependencies.sh"
install:
- pip install ansible ansible-lint
- ansible --version
- "{ echo '[defaults]'; echo 'callback_whitelist = profile_tasks, timer'; echo 'roles_path = ../'; } >> ansible.cfg"
- gem --version
script:
- "echo \"localhost\" > inventory"
# Check the role/playbook's syntax.
- "ansible-lint tasks/main.yml || true"
- "ansible-playbook -i inventory --syntax-check test/integration/default/default.yml"
# Run the role/playbook with ansible-playbook.
- "ansible-playbook -i inventory --connection=local --become -vvvv test/integration/default/default.yml"
# Run the role/playbook again, checking to make sure it's idempotent.
- "ansible-playbook -i inventory test/integration/default/default.yml --connection=local --become | tee /tmp/idempotency.log | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && cat /tmp/idempotency.log && exit 1)"
after_script:
- ps axuw
- sudo netstat -anp
- sudo ss -nlp
- systemctl -l --no-pager status
- sudo journalctl -xe --no-page