mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2025-01-09 11:20:18 +01:00
add separate test playbook for centos7
This commit is contained in:
parent
d190734e84
commit
88409e2079
2 changed files with 38 additions and 22 deletions
45
.travis.yml
45
.travis.yml
|
@ -2,25 +2,26 @@
|
|||
sudo: required
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- distribution: centos
|
||||
version: 6
|
||||
init: /sbin/init
|
||||
run_opts: ""
|
||||
- distribution: centos
|
||||
version: 7
|
||||
init: /usr/lib/systemd/systemd
|
||||
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
||||
- distribution: ubuntu
|
||||
version: 14.04
|
||||
init: /sbin/init
|
||||
run_opts: ""
|
||||
- distribution: ubuntu
|
||||
version: 12.04
|
||||
init: /sbin/init
|
||||
run_opts: ""
|
||||
global:
|
||||
- testfile: test.yml
|
||||
- distribution: centos
|
||||
version: 6
|
||||
init: /sbin/init
|
||||
run_opts: ""
|
||||
playbook: test.yml
|
||||
- distribution: centos
|
||||
version: 7
|
||||
init: /usr/lib/systemd/systemd
|
||||
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
||||
playbook: centos-7-test.yml
|
||||
- distribution: ubuntu
|
||||
version: 14.04
|
||||
init: /sbin/init
|
||||
run_opts: ""
|
||||
playbook: test.yml
|
||||
- distribution: ubuntu
|
||||
version: 12.04
|
||||
init: /sbin/init
|
||||
run_opts: ""
|
||||
playbook: test.yml
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
@ -37,14 +38,14 @@ script:
|
|||
- 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${distribution}-${version}:ansible "${init}" > "${container_id}"'
|
||||
|
||||
# Ansible syntax check.
|
||||
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/${testsite} --syntax-check'
|
||||
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook} --syntax-check'
|
||||
|
||||
# Test role.
|
||||
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/${testsite}'
|
||||
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook}'
|
||||
|
||||
# Test role idempotence.
|
||||
- >
|
||||
sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/${testsite}
|
||||
sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook}
|
||||
| grep -q 'changed=0.*failed=0'
|
||||
&& (echo 'Idempotence test: pass' && exit 0)
|
||||
|| (echo 'Idempotence test: fail' && exit 1)
|
||||
|
|
15
tests/centos-7-test.yml
Normal file
15
tests/centos-7-test.yml
Normal file
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
- hosts: all
|
||||
vars:
|
||||
mysql_packages:
|
||||
- mariadb
|
||||
- mariadb-server
|
||||
- mariadb-libs
|
||||
- MySQL-python
|
||||
- perl-DBD-MySQL
|
||||
mysql_daemon: mariadb
|
||||
mysql_log_error: /var/log/mariadb/mariadb.log
|
||||
mysql_syslog_tag: mariadb
|
||||
mysql_pid_file: /var/run/mariadb/mariadb.pid
|
||||
roles:
|
||||
- role_under_test
|
Loading…
Reference in a new issue