forked from juju4/ansible-remnux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
39 lines (34 loc) · 1.75 KB
/
.travis.yml
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
35
36
37
38
---
dist: trusty
language: python
python: "2.7"
before_install:
- uname -a
- sudo apt-get update -qq
- sudo apt-get install -qq python-apt python-pycurl
# role dependencies
- ln -s ansible-remnux ../remnux
- git clone https://github.com/geerlingguy/ansible-role-java.git ../geerlingguy.java
## FIXME! under travis, 'adding REMnux repository' fails whereas it works with kitchen...
# - sudo add-apt-repository ppa:remnux/stable -y
## http://www.webupd8.org/2016/03/fix-failed-to-fetch-google-chrome_3.html
- sudo sed -i -e 's/deb http/deb [arch=amd64] http/' "/etc/apt/sources.list.d/google-chrome.list"
- cat /etc/apt/sources.list
- ls /etc/apt/sources.list.d/
install:
- pip install ansible
- ansible --version
- "{ echo '[defaults]'; echo 'roles_path = ../'; } >> ansible.cfg"
script:
- "echo \"[test-kitchen]\nlocalhost\" > inventory"
# Check the role/playbook's syntax.
- "ansible-playbook -i inventory --syntax-check test/integration/default/default.yml"
# Run the role/playbook with ansible-playbook.
## some part of the install are greater than default 10min travis timeout
## https://docs.travis-ci.com/user/common-build-problems/#My-builds-are-timing-out
- "ansible-playbook -i inventory --connection=local --sudo -vvvv test/integration/default/default.yml"
## FIXME! https://github.com/travis-ci/travis-ci/issues/3810
# Run the role/playbook again, checking to make sure it's idempotent. known fail.
- "ansible-playbook -i inventory test/integration/default/default.yml --connection=local --sudo | 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 0)"
# serverspec tests
- 'test/integration/default/serverspec/run-local-tests.sh'