mirror of
https://github.com/geerlingguy/ansible-role-apache
synced 2025-01-03 08:40:18 +01:00
Issue #61: Add CentOS 6.
This commit is contained in:
parent
e5d0d58ffe
commit
60726db64b
2 changed files with 20 additions and 1 deletions
10
.travis.yml
10
.travis.yml
|
@ -1,6 +1,14 @@
|
|||
sudo: required
|
||||
|
||||
env:
|
||||
# CentOS 6.
|
||||
- distribution: centos
|
||||
version: 6
|
||||
container_id: $(mktemp)
|
||||
dockerfile: Dockerfile.centos-6
|
||||
init: /sbin/init
|
||||
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
|
||||
|
||||
# CentOS 7.
|
||||
- distribution: centos
|
||||
version: 7
|
||||
|
@ -37,7 +45,7 @@ before_install:
|
|||
|
||||
script:
|
||||
# Run container in detached state.
|
||||
- sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${distribution}:ansible "${init}" > "${container_id}"
|
||||
- 'sudo docker run --detach --volume="${PWD}":/etc/ansible/roles/role_under_test:ro ${run_opts} ${distribution}: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/test.yml --syntax-check'
|
||||
|
|
11
tests/Dockerfile.centos-6
Normal file
11
tests/Dockerfile.centos-6
Normal file
|
@ -0,0 +1,11 @@
|
|||
FROM centos:6
|
||||
|
||||
# Install Ansible
|
||||
RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
|
||||
RUN yum install -y ansible
|
||||
|
||||
# Disable requiretty
|
||||
RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers
|
||||
|
||||
# Install Ansible inventory file
|
||||
RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts
|
Loading…
Reference in a new issue