mirror of
https://github.com/roles-ansible/ansible_role_dotfiles.git
synced 2024-08-16 16:09:49 +02:00
Test new test
This commit is contained in:
parent
6db0ca2f1b
commit
d0fbeeaf51
10 changed files with 154 additions and 12 deletions
16
.travis.yml
16
.travis.yml
|
@ -8,14 +8,6 @@ env:
|
||||||
version: 29
|
version: 29
|
||||||
- distribution: fedora
|
- distribution: fedora
|
||||||
version: 28
|
version: 28
|
||||||
- distribution: fedora
|
|
||||||
version: 27
|
|
||||||
- distribution: fedora
|
|
||||||
version: 26
|
|
||||||
- distribution: fedora
|
|
||||||
version: 25
|
|
||||||
- distribution: fedora
|
|
||||||
version: 24
|
|
||||||
- distribution: ubuntu
|
- distribution: ubuntu
|
||||||
version: bionic
|
version: bionic
|
||||||
- distribution: ubuntu
|
- distribution: ubuntu
|
||||||
|
@ -36,11 +28,11 @@ before_install:
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- container_id=$(mktemp)
|
- container_id=$(mktemp)
|
||||||
- 'sudo docker run --detach --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro --volume="${PWD}":/etc/ansible/roles/nginx_role:ro ${distribution}-${version}:ansible > "${container_id}"'
|
- 'sudo docker run --detach --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro --volume="${PWD}":/etc/ansible/roles/travis_test:ro ${distribution}-${version}:ansible > "${container_id}"'
|
||||||
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/nginx_role/travis/test.yml --syntax-check'
|
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/travis_test/travis/test.yml --syntax-check'
|
||||||
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/nginx_role/travis/test.yml'
|
- 'sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/travis_test/travis/test.yml'
|
||||||
- >
|
- >
|
||||||
sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/nginx_role/travis/test.yml
|
sudo docker exec "$(cat ${container_id})" env ANSIBLE_FORCE_COLOR=1 ansible-playbook -v /etc/ansible/roles/travis_test/travis/test.yml
|
||||||
| grep -q 'changed=0.*failed=0'
|
| grep -q 'changed=0.*failed=0'
|
||||||
&& (echo 'Idempotence test: pass' && exit 0)
|
&& (echo 'Idempotence test: pass' && exit 0)
|
||||||
|| (echo 'Idempotence test: fail' && exit 1)
|
|| (echo 'Idempotence test: fail' && exit 1)
|
||||||
|
|
24
travis/Dockerfile.centos-7
Normal file
24
travis/Dockerfile.centos-7
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
FROM centos:7
|
||||||
|
|
||||||
|
# Install systemd -- See https://hub.docker.com/_/centos/
|
||||||
|
RUN yum -y swap -- remove fakesystemd -- install systemd systemd-libs
|
||||||
|
RUN yum -y update; \
|
||||||
|
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
|
||||||
|
rm -f /lib/systemd/system/multi-user.target.wants/*; \
|
||||||
|
rm -f /etc/systemd/system/*.wants/*; \
|
||||||
|
rm -f /lib/systemd/system/local-fs.target.wants/*; \
|
||||||
|
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
|
||||||
|
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
|
||||||
|
rm -f /lib/systemd/system/basic.target.wants/*; \
|
||||||
|
rm -f /lib/systemd/system/anaconda.target.wants/*;
|
||||||
|
|
||||||
|
RUN yum -y install epel-release
|
||||||
|
RUN yum -y install git ansible sudo
|
||||||
|
|
||||||
|
RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers
|
||||||
|
|
||||||
|
RUN echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts
|
||||||
|
|
||||||
|
VOLUME ["/sys/fs/cgroup"]
|
||||||
|
|
||||||
|
CMD ["/usr/sbin/init"]
|
17
travis/Dockerfile.debian-jessie
Normal file
17
travis/Dockerfile.debian-jessie
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
FROM debian:jessie
|
||||||
|
|
||||||
|
RUN apt-get update -y && apt-get install -y --no-install-recommends \
|
||||||
|
software-properties-common \
|
||||||
|
build-essential \
|
||||||
|
libffi-dev \
|
||||||
|
libssl-dev \
|
||||||
|
python-dev \
|
||||||
|
python-pip \
|
||||||
|
git \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN pip install --upgrade setuptools && pip install ansible
|
||||||
|
|
||||||
|
RUN mkdir -p /etc/ansible && echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
|
||||||
|
|
||||||
|
ENTRYPOINT ["/sbin/init"]
|
18
travis/Dockerfile.debian-stretch
Normal file
18
travis/Dockerfile.debian-stretch
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
FROM debian:stretch
|
||||||
|
|
||||||
|
RUN apt-get update -y && apt-get install -y --no-install-recommends \
|
||||||
|
software-properties-common \
|
||||||
|
build-essential \
|
||||||
|
libffi-dev \
|
||||||
|
libssl-dev \
|
||||||
|
python-dev \
|
||||||
|
python-pip \
|
||||||
|
git \
|
||||||
|
systemd \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN pip install --upgrade setuptools && pip install ansible
|
||||||
|
|
||||||
|
RUN mkdir -p /etc/ansible && echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
|
||||||
|
|
||||||
|
ENTRYPOINT ["/bin/systemd"]
|
25
travis/Dockerfile.fedora-28
Normal file
25
travis/Dockerfile.fedora-28
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
FROM fedora:28
|
||||||
|
|
||||||
|
RUN dnf -y update
|
||||||
|
|
||||||
|
RUN dnf -y install systemd && \
|
||||||
|
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
|
||||||
|
rm -f /lib/systemd/system/multi-user.target.wants/*;\
|
||||||
|
rm -f /etc/systemd/system/*.wants/*;\
|
||||||
|
rm -f /lib/systemd/system/local-fs.target.wants/*; \
|
||||||
|
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
|
||||||
|
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
|
||||||
|
rm -f /lib/systemd/system/basic.target.wants/*;\
|
||||||
|
rm -f /lib/systemd/system/anaconda.target.wants/*;
|
||||||
|
|
||||||
|
RUN dnf -y install python2 python-pip libffi-devel redhat-rpm-config python-devel openssl-devel sudo git @development-tools
|
||||||
|
|
||||||
|
RUN pip install ansible
|
||||||
|
|
||||||
|
RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers
|
||||||
|
|
||||||
|
RUN mkdir -p /etc/ansible && echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts
|
||||||
|
|
||||||
|
VOLUME ["/sys/fs/cgroup"]
|
||||||
|
|
||||||
|
CMD ["/usr/sbin/init"]
|
25
travis/Dockerfile.fedora-29
Normal file
25
travis/Dockerfile.fedora-29
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
FROM fedora:29
|
||||||
|
|
||||||
|
RUN dnf -y update
|
||||||
|
|
||||||
|
RUN dnf -y install systemd && \
|
||||||
|
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
|
||||||
|
rm -f /lib/systemd/system/multi-user.target.wants/*;\
|
||||||
|
rm -f /etc/systemd/system/*.wants/*;\
|
||||||
|
rm -f /lib/systemd/system/local-fs.target.wants/*; \
|
||||||
|
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
|
||||||
|
rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
|
||||||
|
rm -f /lib/systemd/system/basic.target.wants/*;\
|
||||||
|
rm -f /lib/systemd/system/anaconda.target.wants/*;
|
||||||
|
|
||||||
|
RUN dnf -y install python2 python-pip libffi-devel redhat-rpm-config python-devel openssl-devel sudo git @development-tools
|
||||||
|
|
||||||
|
RUN pip install ansible
|
||||||
|
|
||||||
|
RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers
|
||||||
|
|
||||||
|
RUN mkdir -p /etc/ansible && echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts
|
||||||
|
|
||||||
|
VOLUME ["/sys/fs/cgroup"]
|
||||||
|
|
||||||
|
CMD ["/usr/sbin/init"]
|
12
travis/Dockerfile.ubuntu-bionic
Normal file
12
travis/Dockerfile.ubuntu-bionic
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
FROM ubuntu:bionic
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y software-properties-common systemd && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN apt-add-repository -y ppa:ansible/ansible && apt-get update && apt-get install -y \
|
||||||
|
git \
|
||||||
|
ansible \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
|
||||||
|
|
||||||
|
ENTRYPOINT ["/bin/systemd"]
|
12
travis/Dockerfile.ubuntu-trusty
Normal file
12
travis/Dockerfile.ubuntu-trusty
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
FROM ubuntu:trusty
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y software-properties-common && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN apt-add-repository -y ppa:ansible/ansible && apt-get update && apt-get install -y \
|
||||||
|
git \
|
||||||
|
ansible \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
|
||||||
|
|
||||||
|
ENTRYPOINT ["/sbin/init"]
|
12
travis/Dockerfile.ubuntu-xenial
Normal file
12
travis/Dockerfile.ubuntu-xenial
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
FROM ubuntu:xenial
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y software-properties-common && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN apt-add-repository -y ppa:ansible/ansible && apt-get update && apt-get install -y \
|
||||||
|
git \
|
||||||
|
ansible \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN echo "[local]\nlocalhost ansible_connection=local" > /etc/ansible/hosts
|
||||||
|
|
||||||
|
ENTRYPOINT ["/sbin/init"]
|
5
travis/test.yml
Normal file
5
travis/test.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
|
||||||
|
roles:
|
||||||
|
- travis_test
|
Loading…
Reference in a new issue