forked from awailly/cis-ubuntu-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
122 lines (92 loc) · 5.17 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# cis-ubuntu-ansible
#
# VERSION 1.0
FROM ubuntu:14.04
MAINTAINER Paul Chaignon <[email protected]>
ADD . /cis-ubuntu-ansible
WORKDIR /cis-ubuntu-ansible
RUN apt-get update
RUN apt-get -y install python-pip aptitude rsh-client rsh-redone-client talk avahi-daemon cups isc-dhcp-server ntp rpcbind nfs-kernel-server bind9 openssh-client openssh-server python-dev slapd nis
RUN pip install ansible
RUN touch /etc/inetd.conf
RUN echo 'shell.bla' > /tmp/inetd
RUN cp /tmp/inetd /etc/inetd.conf
RUN echo 'start on runlevel [2345]' > /tmp/runxinit
RUN cp /tmp/runxinit /etc/init/xinetd.conf
RUN echo hello >> "hard'to\"quote$file"
RUN chown 1234:4321 "hard'to\"quote$file"
RUN cp tests/docker_defaults.yml vars/main.yml
RUN echo '[defaults]' > ansible.cfg
RUN echo 'roles_path = ../' >> ansible.cfg
RUN ansible-playbook -i tests/inventory tests/playbook.yml --syntax-check
RUN ansible-playbook -i tests/inventory tests/playbook.yml --connection=local --sudo -e "pipelining=True" -t level1
RUN ansible-playbook -i tests/inventory tests/playbook.yml --connection=local --sudo -e "pipelining=True" -t level1 > results_indempotence.txt
RUN cat results_indempotence.txt
RUN cat results_indempotence.txt | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
FROM ubuntu:12.04
MAINTAINER Paul Chaignon <[email protected]>
ADD . /cis-ubuntu-ansible
WORKDIR /cis-ubuntu-ansible
RUN apt-get update
RUN apt-get -y install python-pip aptitude rsh-client rsh-redone-client talk avahi-daemon cups isc-dhcp-server ntp rpcbind nfs-kernel-server bind9 openssh-client openssh-server python-dev slapd nis sudo
RUN pip install ansible
RUN touch /etc/inetd.conf
RUN echo 'shell.bla' > /tmp/inetd
RUN cp /tmp/inetd /etc/inetd.conf
RUN echo 'start on runlevel [2345]' > /tmp/runxinit
RUN cp /tmp/runxinit /etc/init/xinetd.conf
RUN echo hello >> "hard'to\"quote$file"
RUN chown 1234:4321 "hard'to\"quote$file"
RUN cp tests/docker_defaults.yml vars/main.yml
RUN echo '[defaults]' > ansible.cfg
RUN echo 'roles_path = ../' >> ansible.cfg
RUN ansible-playbook -i tests/inventory tests/playbook.yml --syntax-check
RUN ansible-playbook -i tests/inventory tests/playbook.yml --connection=local --sudo -e "pipelining=True" -t level1
RUN ansible-playbook -i tests/inventory tests/playbook.yml --connection=local --sudo -e "pipelining=True" -t level1 > results_indempotence.txt
RUN cat results_indempotence.txt
RUN cat results_indempotence.txt | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
FROM ubuntu:15.04
MAINTAINER Paul Chaignon <[email protected]>
ADD . /cis-ubuntu-ansible
WORKDIR /cis-ubuntu-ansible
RUN apt-get update
RUN apt-get -y install python-pip aptitude rsh-client rsh-redone-client talk avahi-daemon cups isc-dhcp-server ntp rpcbind nfs-kernel-server bind9 openssh-client openssh-server python-dev sudo
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install slapd nis
RUN pip install ansible
RUN touch /etc/inetd.conf
RUN echo 'shell.bla' > /tmp/inetd
RUN cp /tmp/inetd /etc/inetd.conf
RUN echo 'start on runlevel [2345]' > /tmp/runxinit
RUN cp /tmp/runxinit /etc/init/xinetd.conf
RUN echo hello >> "hard'to\"quote$file"
RUN chown 1234:4321 "hard'to\"quote$file"
RUN cp tests/docker_nofirewall_defaults.yml vars/main.yml
RUN echo '[defaults]' > ansible.cfg
RUN echo 'roles_path = ../' >> ansible.cfg
RUN ansible-playbook -i tests/inventory tests/playbook.yml --syntax-check
RUN ansible-playbook -i tests/inventory tests/playbook.yml --connection=local --sudo -e "pipelining=True" -t level1
RUN ansible-playbook -i tests/inventory tests/playbook.yml --connection=local --sudo -e "pipelining=True" -t level1 > results_indempotence.txt
RUN cat results_indempotence.txt
RUN cat results_indempotence.txt | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)
FROM ubuntu:14.10
MAINTAINER Paul Chaignon <[email protected]>
ADD . /cis-ubuntu-ansible
WORKDIR /cis-ubuntu-ansible
RUN apt-get update
RUN apt-get -y install python-pip aptitude rsh-client rsh-redone-client talk avahi-daemon cups isc-dhcp-server ntp rpcbind nfs-kernel-server bind9 openssh-client openssh-server python-dev slapd nis
RUN pip install ansible
RUN touch /etc/inetd.conf
RUN echo 'shell.bla' > /tmp/inetd
RUN cp /tmp/inetd /etc/inetd.conf
RUN echo 'start on runlevel [2345]' > /tmp/runxinit
RUN cp /tmp/runxinit /etc/init/xinetd.conf
RUN echo hello >> "hard'to\"quote$file"
RUN chown 1234:4321 "hard'to\"quote$file"
RUN cp tests/docker_nofirewall_defaults.yml vars/main.yml
RUN echo '[defaults]' > ansible.cfg
RUN echo 'roles_path = ../' >> ansible.cfg
RUN ansible-playbook -i tests/inventory tests/playbook.yml --syntax-check
RUN ansible-playbook -i tests/inventory tests/playbook.yml --connection=local --sudo -e "pipelining=True" -t level1
RUN ansible-playbook -i tests/inventory tests/playbook.yml --connection=local --sudo -e "pipelining=True" -t level1 > results_indempotence.txt
RUN cat results_indempotence.txt
RUN cat results_indempotence.txt | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && exit 1)