37 lines
962 B
YAML
37 lines
962 B
YAML
---
|
|
language: python
|
|
python: "2.7"
|
|
|
|
env:
|
|
global:
|
|
- ANSIBLE_CONFIG=tests/ansible.cfg
|
|
matrix:
|
|
- SITE=test001.yaml
|
|
- SITE=test002.yaml
|
|
|
|
before_install:
|
|
- sudo apt-get update -qq
|
|
|
|
install:
|
|
# Install Ansible.
|
|
- pip install ansible
|
|
|
|
script:
|
|
# Check the role/playbook's syntax.
|
|
- "ansible-playbook -i tests/inventory tests/$SITE --syntax-check"
|
|
|
|
# Run the role/playbook with ansible-playbook.
|
|
- "ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo"
|
|
|
|
# Run the role/playbook again, checking to make sure it's idempotent.
|
|
- >
|
|
ansible-playbook -i tests/inventory tests/$SITE --connection=local --sudo
|
|
|| grep -q 'changed=0.*failed=0'
|
|
&& (echo 'Idempotence test: pass' && exit 0)
|
|
|| (echo 'Idempotence test: fail' && exit 1)
|
|
|
|
# Create a ubuntu trusty dib using disk-image-create.
|
|
- "disk-image-create ubuntu vm"
|
|
# Create a centos 6 dib using disk-image-create.
|
|
- "disk-image-create centos vm"
|