Skip to content

Commit

Permalink
Update Travis test environment
Browse files Browse the repository at this point in the history
Merge branch 'feature/travis-lxc-updates' into develop
  • Loading branch information
lae committed May 14, 2018
2 parents 69b3788 + ab19ab0 commit b010844
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 33 deletions.
50 changes: 25 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,36 @@ dist: trusty
cache:
directories: [ '$HOME/lxc' ]
pip: true
env:
- LXC_DISTRO=debian LXC_RELEASE=jessie
- LXC_DISTRO=debian LXC_RELEASE=stretch
- ANSIBLE_VERSION='git+https://github.com/ansible/ansible.git@devel' #2.6 DEVEL on debian stretch
- ANSIBLE_VERSION='ansible>=2.4.0,<2.5.0' #2.4.x on debian stretch
- ANSIBLE_VERSION='ansible>=2.3.0,<2.4.0' #2.3.x on debian stretch
matrix:
fast_finish: true
before_cache:
- sudo mkdir $HOME/lxc && sudo tar cf $HOME/lxc/cache.tar /var/cache/lxc/ && sudo chown $USER. $HOME/lxc/cache.tar
env:
- ANSIBLE_GIT_VERSION='devel' # 2.6.x development branch
- ANSIBLE_VERSION='<2.6.0' # 2.5.x
- ANSIBLE_VERSION='<2.5.0' # 2.4.x
install:
- sudo tar xf $HOME/lxc/cache.tar -C / || true
- sudo apt-get install -y expect-dev
- pip install ansible jmespath
- if [ "$ANSIBLE_GIT_VERSION" ]; then pip install "https://github.com/ansible/ansible/archive/${ANSIBLE_GIT_VERSION}.tar.gz";
elif [ "$ANSIBLE_VERSION" ]; then pip install "ansible${ANSIBLE_VERSION}";
else pip install ansible; fi;
pip install jmespath
- ansible --version
- printf '[defaults]\nroles_path=../\ncallback_whitelist=profile_tasks' >ansible.cfg
# The following is needed for default Ansible 2.3 installations
- 'sudo mkdir -p /etc/ansible/roles && sudo chown $(whoami): /etc/ansible/roles'
- ansible-galaxy install lae.travis-lxc
- ansible-playbook -vvv tests/install.yml -i tests/inventory
- ansible-playbook tests/install.yml -i tests/inventory
- git archive --format tar.gz HEAD > lae.proxmox.tar.gz && ansible-galaxy install
lae.proxmox.tar.gz,$(git rev-parse HEAD),lae.proxmox && rm lae.proxmox.tar.gz
before_script: cd tests/
script:
- ansible-playbook tests/deploy.yml -i tests/inventory --syntax-check
- ansible-playbook tests/deploy.yml -i tests/inventory --skip skiponlxc
- 'ANSIBLE_STDOUT_CALLBACK=debug unbuffer ansible-playbook -vv tests/deploy.yml
-i tests/inventory --skip skiponlxc >/tmp/idempotency.log 2>&1 ||
(e=$?; cat /tmp/idempotency.log; exit $e)'
- 'grep -A1 "PLAY RECAP" /tmp/idempotency.log | grep -qP "changed=0.*failed=0" &&
(echo "Idempotence: PASS"; exit 0) ||
(echo "Idempotence: FAIL"; cat /tmp/idempotency.log; exit 1)'
- ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook -v tests/test.yml -i tests/inventory

- ansible-playbook -i inventory deploy.yml --syntax-check
- ansible-playbook -i inventory -v deploy.yml --skip skiponlxc
- 'ANSIBLE_STDOUT_CALLBACK=debug unbuffer ansible-playbook --skip skiponlxc -vv
-i inventory deploy.yml > idempotency.log 2>&1 || (e=$?; cat idempotency.log; exit $e)'
- 'grep -A1 "PLAY RECAP" idempotency.log | grep -qP "changed=0 .*failed=0 .*" &&
(echo "Idempotence: PASS"; exit 0) || (echo "Idempotence: FAIL"; exit 1)'
- ANSIBLE_STDOUT_CALLBACK=debug ansible-playbook -i inventory -v test.yml
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
slack:
secure: ftqNxPWTKL0GTozlHohkYIoh+8j/bQe7lLt+5gtzvvdFhF9N/99KCRgMRVVp9ggNyPp3fELpKXtdeLv4/RXDYtlNWR/dRR5l1vgUoXA/kA6UBJ52LziivH8P84Pe6G9Iy20SHC9nhm16yHmiivXxdS41pi5Mbs+Mblog9jYLBKXY0V9nlrv/agfdLmR3qk5mxAtPNPHYfC+R3YjedPasK7nyEYaWV29uHH3rEjhnrjRwdNuB981K7T+l5vIKieXNvsF+kaXYWGKxY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VBOcKx/Ku8uR+Kcdj7oEoAcJRF5eZFMG1y5Wk="
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ galaxy_info:
company: FireEye, Inc.
license: MIT

min_ansible_version: 2.3
min_ansible_version: 2.4

platforms:
- name: Debian
Expand Down
4 changes: 2 additions & 2 deletions tests/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- hosts: proxmox
- hosts: all
become: True
roles:
- ansible-role-proxmox
- lae.proxmox
2 changes: 2 additions & 0 deletions tests/group_vars/pve4x
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
pve_group: pve4x
2 changes: 2 additions & 0 deletions tests/group_vars/pve5x
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
pve_group: pve5x
9 changes: 7 additions & 2 deletions tests/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- hosts: localhost
connection: local
roles:
- { name: lae.travis-lxc }
- lae.travis-lxc
tasks:
- name: Create SSL directory for storing secrets
file:
Expand All @@ -13,7 +13,12 @@
- name: Create Root CA certificate
shell: "openssl req -x509 -new -nodes -key {{ ssl_ca_key_path }} -sha256 -days 1 -subj '{{ ssl_subj }}' -out {{ ssl_ca_cert_path }}"
vars:
host_quantity: 3
test_profiles:
- profile: debian-stretch
prefix: proxmox-5-
- profile: debian-jessie
prefix: proxmox-4-
test_hosts_per_profile: 3

# Run the following within the containers in the inventory
- hosts: all
Expand Down
7 changes: 5 additions & 2 deletions tests/inventory
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
[proxmox]
test[01:03].lxc
[pve5x]
proxmox-5-[01:03].lxc

[pve4x]
proxmox-4-[01:03].lxc
2 changes: 1 addition & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- hosts: proxmox
- hosts: all
tasks:
- name: Ensure Proxmox Web UI returns a successful HTTP response
uri:
Expand Down

0 comments on commit b010844

Please sign in to comment.