mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2024-12-22 11:00:18 +01:00
Fix docker run on Ubuntu
This commit is contained in:
parent
609812fb48
commit
33c4876d51
1 changed files with 10 additions and 3 deletions
13
.travis.yml
13
.travis.yml
|
@ -19,17 +19,24 @@ script:
|
|||
# Run test playbook on Ubuntu container
|
||||
#
|
||||
|
||||
# Run container in detached state
|
||||
- sudo docker run --detach ubuntu:ansible /sbin/init > "${CONTAINER_ID}"
|
||||
|
||||
|
||||
# Syntax check
|
||||
- sudo docker run ubuntu:ansible ansible-playbook /etc/ansible/test.yml --syntax-check
|
||||
- sudo docker exec "$(cat ${CONTAINER_ID})" ansible-playbook /etc/ansible/test.yml --syntax-check
|
||||
# Test role
|
||||
- sudo docker run ubuntu:ansible ansible-playbook /etc/ansible/test.yml
|
||||
- sudo docker exec "$(cat ${CONTAINER_ID})" ansible-playbook /etc/ansible/test.yml
|
||||
# Idempotence test
|
||||
- >
|
||||
sudo docker run ubuntu:ansible ansible-playbook /etc/ansible/test.yml
|
||||
sudo docker exec "$(cat ${CONTAINER_ID})" ansible-playbook /etc/ansible/test.yml
|
||||
| grep -q 'changed=0.*failed=0'
|
||||
&& (echo 'Idempotence test: pass' && exit 0)
|
||||
|| (echo 'Idempotence test: fail' && exit 1)
|
||||
|
||||
# Clean up
|
||||
- sudo docker stop "$(cat ${CONTAINER_ID})"
|
||||
|
||||
#
|
||||
# Run test playbook on CentOS container
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue