-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.travis.yml
More file actions
22 lines (21 loc) · 862 Bytes
/
.travis.yml
File metadata and controls
22 lines (21 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
language: python
python: "2.7"
before_install:
- sudo apt-get update -qq
install:
- pip install ansible-lint
- pip install flake8
script:
# verify the syntax of the playbook
- ansible-lint tasks/main.yml
# setup the environment to run ansible
- "echo '---\n- hosts: 127.0.0.1\n remote_user: root\n roles:' > role.yml"
- echo " - ${TRAVIS_REPO_SLUG/*\//}" >> role.yml
- "echo '[defaults]\nroles_path = ../\n' > ansible.cfg"
# run a 2nd syntax check ( not sure if ansible-lint shouldn't already do that )
- ansible-playbook -i '127.0.0.1,' --syntax-check role.yml
# check that the role can be run
- ansible-playbook -i '127.0.0.1,' -c local --sudo -vvvv role.yml
# verify idempotence ( ie, running a 2nd time shouldn't change anything )
- ansible-playbook -i '127.0.0.1,' -c local --sudo -vvvv role.yml | grep -q 'changed=0.*failed=0'