forked from lae/ansible-role-netbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
51 lines (51 loc) · 1.93 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
39
40
41
42
43
44
45
46
47
48
49
50
51
language: python
python:
- "2.7"
- "3.6"
sudo: required
dist: bionic
cache:
directories: [ '$HOME/lxc' ]
pip: true
services:
- postgresql
addons:
postgresql: "9.6"
env:
- ANSIBLE_VERSION='~=2.9.0'
matrix:
fast_finish: true
# FIXME: Ansible 2.10.x going through major restructuring.
# https://groups.google.com/forum/#!msg/ansible-project/eXsoOKEd0Mk/XTgbnPWbCAAJ
# include:
# - python: '3.6'
# env: ANSIBLE_GIT_VERSION='devel' # 2.10.x development branch
install:
- if [ "$ANSIBLE_GIT_VERSION" ]; then pip install "https://github.com/ansible/ansible/archive/${ANSIBLE_GIT_VERSION}.tar.gz";
else pip install "ansible${ANSIBLE_VERSION}"; fi;
pip install --pre ansible-lint
- ansible --version
- ansible-galaxy install lae.travis-lxc,v0.9.0
- ansible-playbook tests/install.yml -i tests/inventory
- git archive --format tar.gz HEAD > lae.netbox.tar.gz && ansible-galaxy install
lae.netbox.tar.gz,$(git rev-parse HEAD),lae.netbox && rm lae.netbox.tar.gz
before_script:
- echo "host all all 10.0.3.0/24 trust" | sudo tee -a /etc/postgresql/9.6/main/pg_hba.conf
- echo "listen_addresses = '*'" | sudo tee -a /etc/postgresql/9.6/main/postgresql.conf
- sudo service postgresql restart
- sudo redis-server /etc/redis/redis.conf --bind 10.0.3.1 --protected-mode no --port 6379
- cd tests/
script:
- ansible-lint ../ || true
- ansible-playbook -i inventory deploy.yml --syntax-check
- ansible-playbook -i inventory deploy.yml
- 'ANSIBLE_STDOUT_CALLBACK=debug ANSIBLE_DISPLAY_SKIPPED_HOSTS=no ANSIBLE_DISPLAY_OK_HOSTS=no
unbuffer ansible-playbook -vvi inventory deploy.yml &>play.log; printf "Idempotence: ";
grep -A1 "PLAY RECAP" play.log | grep -qP "changed=0 .*failed=0 .*"
&& (echo "PASS"; exit 0) || (echo "FAIL"; cat play.log; exit 1)'
- ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook -i inventory -v test.yml
notifications:
webhooks:
urls:
- https://galaxy.ansible.com/api/v1/notifications/
- https://t2d.idolactiviti.es/notify