Issue #61: Add CentOS 6.

This commit is contained in:
Jeff Geerling 2015-12-13 20:20:24 -06:00
parent e5d0d58ffe
commit 60726db64b
2 changed files with 20 additions and 1 deletions

View file

@ -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
View 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