diff options
author | William Yeh <william.pjyeh@gmail.com> | 2017-09-11 18:37:48 +0800 |
---|---|---|
committer | William Yeh <william.pjyeh@gmail.com> | 2017-09-13 17:44:29 +0800 |
commit | 57d366d79328ee5d127d05644b108bd4f7915cdc (patch) | |
tree | a10900020176785d9732634ae5baac2ddb4734a5 | |
parent | 7d885c87026bc44450b79f504b9a5becf0969783 (diff) | |
download | docker-ansible-57d366d79328ee5d127d05644b108bd4f7915cdc.tar.gz docker-ansible-57d366d79328ee5d127d05644b108bd4f7915cdc.tar.zst docker-ansible-57d366d79328ee5d127d05644b108bd4f7915cdc.zip |
Add: Windows managed node support via "pywinrm".
Remove: old distributions wheezy, precise, centos6.
Remove: Ansible 1.9 was not supported in CentOS EPEL.
See http://www.spinics.net/linux/fedora/epel-devel/msg00792.html
50 files changed, 59 insertions, 1889 deletions
diff --git a/.travis.yml b/.travis.yml index ac9983b..7d2af6d 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -8,55 +8,35 @@ before_install: | |||
8 | 8 | ||
9 | - docker build -t ansible_xenial ubuntu16.04 | 9 | - docker build -t ansible_xenial ubuntu16.04 |
10 | - docker build -t ansible_trusty ubuntu14.04 | 10 | - docker build -t ansible_trusty ubuntu14.04 |
11 | - docker build -t ansible_precise ubuntu12.04 | ||
12 | - docker build -t ansible_jessie debian8 | 11 | - docker build -t ansible_jessie debian8 |
13 | - docker build -t ansible_wheezy debian7 | ||
14 | - docker build -t ansible_centos7 centos7 | 12 | - docker build -t ansible_centos7 centos7 |
15 | - docker build -t ansible_centos6 centos6 | ||
16 | - docker build -t ansible_alpine3 alpine3 | 13 | - docker build -t ansible_alpine3 alpine3 |
17 | 14 | ||
18 | - docker build -t ansible_xenial_onbuild ubuntu16.04-onbuild | 15 | - docker build -t ansible_xenial_onbuild ubuntu16.04-onbuild |
19 | - docker build -t ansible_trusty_onbuild ubuntu14.04-onbuild | 16 | - docker build -t ansible_trusty_onbuild ubuntu14.04-onbuild |
20 | - docker build -t ansible_precise_onbuild ubuntu12.04-onbuild | ||
21 | - docker build -t ansible_jessie_onbuild debian8-onbuild | 17 | - docker build -t ansible_jessie_onbuild debian8-onbuild |
22 | - docker build -t ansible_wheezy_onbuild debian7-onbuild | ||
23 | - docker build -t ansible_centos7_onbuild centos7-onbuild | 18 | - docker build -t ansible_centos7_onbuild centos7-onbuild |
24 | - docker build -t ansible_centos6_onbuild centos6-onbuild | ||
25 | - docker build -t ansible_alpine3_onbuild alpine3-onbuild | 19 | - docker build -t ansible_alpine3_onbuild alpine3-onbuild |
26 | 20 | ||
27 | 21 | ||
28 | - docker build -t ansible_1.9_trusty 1.9-ubuntu14.04 | 22 | - docker build -t ansible_1.9_trusty 1.9-ubuntu14.04 |
29 | - docker build -t ansible_1.9_precise 1.9-ubuntu12.04 | ||
30 | - docker build -t ansible_1.9_jessie 1.9-debian8 | 23 | - docker build -t ansible_1.9_jessie 1.9-debian8 |
31 | - docker build -t ansible_1.9_wheezy 1.9-debian7 | ||
32 | - docker build -t ansible_1.9_centos7 1.9-centos7 | ||
33 | - docker build -t ansible_1.9_centos6 1.9-centos6 | ||
34 | - docker build -t ansible_1.9_alpine3 1.9-alpine3 | 24 | - docker build -t ansible_1.9_alpine3 1.9-alpine3 |
35 | 25 | ||
36 | - docker build -t ansible_1.9_trusty_onbuild 1.9-ubuntu14.04-onbuild | 26 | - docker build -t ansible_1.9_trusty_onbuild 1.9-ubuntu14.04-onbuild |
37 | - docker build -t ansible_1.9_precise_onbuild 1.9-ubuntu12.04-onbuild | ||
38 | - docker build -t ansible_1.9_jessie_onbuild 1.9-debian8-onbuild | 27 | - docker build -t ansible_1.9_jessie_onbuild 1.9-debian8-onbuild |
39 | - docker build -t ansible_1.9_wheezy_onbuild 1.9-debian7-onbuild | ||
40 | - docker build -t ansible_1.9_centos7_onbuild 1.9-centos7-onbuild | ||
41 | - docker build -t ansible_1.9_centos6_onbuild 1.9-centos6-onbuild | ||
42 | - docker build -t ansible_1.9_alpine3_onbuild 1.9-alpine3-onbuild | 28 | - docker build -t ansible_1.9_alpine3_onbuild 1.9-alpine3-onbuild |
43 | 29 | ||
44 | 30 | ||
45 | - docker build -t ansible_master_xenial master-ubuntu16.04 | 31 | - docker build -t ansible_master_xenial master-ubuntu16.04 |
46 | - docker build -t ansible_master_trusty master-ubuntu14.04 | 32 | - docker build -t ansible_master_trusty master-ubuntu14.04 |
47 | - docker build -t ansible_master_precise master-ubuntu12.04 | ||
48 | - docker build -t ansible_master_jessie master-debian8 | 33 | - docker build -t ansible_master_jessie master-debian8 |
49 | - docker build -t ansible_master_wheezy master-debian7 | ||
50 | - docker build -t ansible_master_centos7 master-centos7 | 34 | - docker build -t ansible_master_centos7 master-centos7 |
51 | - docker build -t ansible_master_centos6 master-centos6 | ||
52 | 35 | ||
53 | - docker build -t ansible_master_xenial_onbuild master-ubuntu16.04-onbuild | 36 | - docker build -t ansible_master_xenial_onbuild master-ubuntu16.04-onbuild |
54 | - docker build -t ansible_master_trusty_onbuild master-ubuntu14.04-onbuild | 37 | - docker build -t ansible_master_trusty_onbuild master-ubuntu14.04-onbuild |
55 | - docker build -t ansible_master_precise_onbuild master-ubuntu12.04-onbuild | ||
56 | - docker build -t ansible_master_jessie_onbuild master-debian8-onbuild | 38 | - docker build -t ansible_master_jessie_onbuild master-debian8-onbuild |
57 | - docker build -t ansible_master_wheezy_onbuild master-debian7-onbuild | ||
58 | - docker build -t ansible_master_centos7_onbuild master-centos7-onbuild | 39 | - docker build -t ansible_master_centos7_onbuild master-centos7-onbuild |
59 | - docker build -t ansible_master_centos6_onbuild master-centos6-onbuild | ||
60 | 40 | ||
61 | 41 | ||
62 | - docker build -t ansible_mini_alpine3 mini-alpine3 | 42 | - docker build -t ansible_mini_alpine3 mini-alpine3 |
@@ -68,52 +48,32 @@ before_install: | |||
68 | script: | 48 | script: |
69 | - docker run -i ansible_xenial > result-ubuntu16.04 | 49 | - docker run -i ansible_xenial > result-ubuntu16.04 |
70 | - docker run -i ansible_trusty > result-ubuntu14.04 | 50 | - docker run -i ansible_trusty > result-ubuntu14.04 |
71 | - docker run -i ansible_precise > result-ubuntu12.04 | ||
72 | - docker run -i ansible_jessie > result-debian8 | 51 | - docker run -i ansible_jessie > result-debian8 |
73 | - docker run -i ansible_wheezy > result-debian7 | ||
74 | - docker run -i ansible_centos7 > result-centos7 | 52 | - docker run -i ansible_centos7 > result-centos7 |
75 | - docker run -i ansible_centos6 > result-centos6 | ||
76 | - docker run -i ansible_alpine3 > result-alpine3 | 53 | - docker run -i ansible_alpine3 > result-alpine3 |
77 | - docker run -i ansible_xenial_onbuild > result-ubuntu16.04-onbuild | 54 | - docker run -i ansible_xenial_onbuild > result-ubuntu16.04-onbuild |
78 | - docker run -i ansible_trusty_onbuild > result-ubuntu14.04-onbuild | 55 | - docker run -i ansible_trusty_onbuild > result-ubuntu14.04-onbuild |
79 | - docker run -i ansible_precise_onbuild > result-ubuntu12.04-onbuild | ||
80 | - docker run -i ansible_jessie_onbuild > result-debian8-onbuild | 56 | - docker run -i ansible_jessie_onbuild > result-debian8-onbuild |
81 | - docker run -i ansible_wheezy_onbuild > result-debian7-onbuild | ||
82 | - docker run -i ansible_centos7_onbuild > result-centos7-onbuild | 57 | - docker run -i ansible_centos7_onbuild > result-centos7-onbuild |
83 | - docker run -i ansible_centos6_onbuild > result-centos6-onbuild | ||
84 | - docker run -i ansible_alpine3_onbuild > result-alpine3-onbuild | 58 | - docker run -i ansible_alpine3_onbuild > result-alpine3-onbuild |
85 | 59 | ||
86 | 60 | ||
87 | - docker run -i ansible_1.9_trusty > result-1.9-ubuntu14.04 | 61 | - docker run -i ansible_1.9_trusty > result-1.9-ubuntu14.04 |
88 | - docker run -i ansible_1.9_precise > result-1.9-ubuntu12.04 | ||
89 | - docker run -i ansible_1.9_jessie > result-1.9-debian8 | 62 | - docker run -i ansible_1.9_jessie > result-1.9-debian8 |
90 | - docker run -i ansible_1.9_wheezy > result-1.9-debian7 | ||
91 | - docker run -i ansible_1.9_centos7 > result-1.9-centos7 | ||
92 | - docker run -i ansible_1.9_centos6 > result-1.9-centos6 | ||
93 | - docker run -i ansible_1.9_alpine3 > result-1.9-alpine3 | 63 | - docker run -i ansible_1.9_alpine3 > result-1.9-alpine3 |
94 | - docker run -i ansible_1.9_trusty_onbuild > result-1.9-ubuntu14.04-onbuild | 64 | - docker run -i ansible_1.9_trusty_onbuild > result-1.9-ubuntu14.04-onbuild |
95 | - docker run -i ansible_1.9_precise_onbuild > result-1.9-ubuntu12.04-onbuild | ||
96 | - docker run -i ansible_1.9_jessie_onbuild > result-1.9-debian8-onbuild | 65 | - docker run -i ansible_1.9_jessie_onbuild > result-1.9-debian8-onbuild |
97 | - docker run -i ansible_1.9_wheezy_onbuild > result-1.9-debian7-onbuild | ||
98 | - docker run -i ansible_1.9_centos7_onbuild > result-1.9-centos7-onbuild | ||
99 | - docker run -i ansible_1.9_centos6_onbuild > result-1.9-centos6-onbuild | ||
100 | - docker run -i ansible_1.9_alpine3_onbuild > result-1.9-alpine3-onbuild | 66 | - docker run -i ansible_1.9_alpine3_onbuild > result-1.9-alpine3-onbuild |
101 | 67 | ||
102 | 68 | ||
103 | - docker run -i ansible_master_xenial > result-master-ubuntu16.04 | 69 | - docker run -i ansible_master_xenial > result-master-ubuntu16.04 |
104 | - docker run -i ansible_master_trusty > result-master-ubuntu14.04 | 70 | - docker run -i ansible_master_trusty > result-master-ubuntu14.04 |
105 | - docker run -i ansible_master_precise > result-master-ubuntu12.04 | ||
106 | - docker run -i ansible_master_jessie > result-master-debian8 | 71 | - docker run -i ansible_master_jessie > result-master-debian8 |
107 | - docker run -i ansible_master_wheezy > result-master-debian7 | ||
108 | - docker run -i ansible_master_centos7 > result-master-centos7 | 72 | - docker run -i ansible_master_centos7 > result-master-centos7 |
109 | - docker run -i ansible_master_centos6 > result-master-centos6 | ||
110 | - docker run -i ansible_master_xenial_onbuild > result-master-ubuntu16.04-onbuild | 73 | - docker run -i ansible_master_xenial_onbuild > result-master-ubuntu16.04-onbuild |
111 | - docker run -i ansible_master_trusty_onbuild > result-master-ubuntu14.04-onbuild | 74 | - docker run -i ansible_master_trusty_onbuild > result-master-ubuntu14.04-onbuild |
112 | - docker run -i ansible_master_precise_onbuild > result-master-ubuntu12.04-onbuild | ||
113 | - docker run -i ansible_master_jessie_onbuild > result-master-debian8-onbuild | 75 | - docker run -i ansible_master_jessie_onbuild > result-master-debian8-onbuild |
114 | - docker run -i ansible_master_wheezy_onbuild > result-master-debian7-onbuild | ||
115 | - docker run -i ansible_master_centos7_onbuild > result-master-centos7-onbuild | 76 | - docker run -i ansible_master_centos7_onbuild > result-master-centos7-onbuild |
116 | - docker run -i ansible_master_centos6_onbuild > result-master-centos6-onbuild | ||
117 | 77 | ||
118 | 78 | ||
119 | - docker run -i nginx_alpine3 2> result-nginx-alpine3 | 79 | - docker run -i nginx_alpine3 2> result-nginx-alpine3 |
@@ -123,50 +83,30 @@ script: | |||
123 | - echo "==> Validating the test results..." | 83 | - echo "==> Validating the test results..." |
124 | - sh -c "[ -s result-ubuntu16.04 ]" | 84 | - sh -c "[ -s result-ubuntu16.04 ]" |
125 | - sh -c "[ -s result-ubuntu14.04 ]" | 85 | - sh -c "[ -s result-ubuntu14.04 ]" |
126 | - sh -c "[ -s result-ubuntu12.04 ]" | ||
127 | - sh -c "[ -s result-debian8 ]" | 86 | - sh -c "[ -s result-debian8 ]" |
128 | - sh -c "[ -s result-debian7 ]" | ||
129 | - sh -c "[ -s result-centos7 ]" | 87 | - sh -c "[ -s result-centos7 ]" |
130 | - sh -c "[ -s result-centos6 ]" | ||
131 | - sh -c "[ -s result-alpine3 ]" | 88 | - sh -c "[ -s result-alpine3 ]" |
132 | - sh -c "[ -s result-ubuntu16.04-onbuild ]" | 89 | - sh -c "[ -s result-ubuntu16.04-onbuild ]" |
133 | - sh -c "[ -s result-ubuntu14.04-onbuild ]" | 90 | - sh -c "[ -s result-ubuntu14.04-onbuild ]" |
134 | - sh -c "[ -s result-ubuntu12.04-onbuild ]" | ||
135 | - sh -c "[ -s result-debian8-onbuild ]" | 91 | - sh -c "[ -s result-debian8-onbuild ]" |
136 | - sh -c "[ -s result-debian7-onbuild ]" | ||
137 | - sh -c "[ -s result-centos7-onbuild ]" | 92 | - sh -c "[ -s result-centos7-onbuild ]" |
138 | - sh -c "[ -s result-centos6-onbuild ]" | ||
139 | - sh -c "[ -s result-alpine3-onbuild ]" | 93 | - sh -c "[ -s result-alpine3-onbuild ]" |
140 | 94 | ||
141 | - sh -c "[ -s result-1.9-ubuntu14.04 ]" | 95 | - sh -c "[ -s result-1.9-ubuntu14.04 ]" |
142 | - sh -c "[ -s result-1.9-ubuntu12.04 ]" | ||
143 | - sh -c "[ -s result-1.9-debian8 ]" | 96 | - sh -c "[ -s result-1.9-debian8 ]" |
144 | - sh -c "[ -s result-1.9-debian7 ]" | ||
145 | - sh -c "[ -s result-1.9-centos7 ]" | ||
146 | - sh -c "[ -s result-1.9-centos6 ]" | ||
147 | - sh -c "[ -s result-1.9-alpine3 ]" | 97 | - sh -c "[ -s result-1.9-alpine3 ]" |
148 | - sh -c "[ -s result-1.9-ubuntu14.04-onbuild ]" | 98 | - sh -c "[ -s result-1.9-ubuntu14.04-onbuild ]" |
149 | - sh -c "[ -s result-1.9-ubuntu12.04-onbuild ]" | ||
150 | - sh -c "[ -s result-1.9-debian8-onbuild ]" | 99 | - sh -c "[ -s result-1.9-debian8-onbuild ]" |
151 | - sh -c "[ -s result-1.9-debian7-onbuild ]" | ||
152 | - sh -c "[ -s result-1.9-centos7-onbuild ]" | ||
153 | - sh -c "[ -s result-1.9-centos6-onbuild ]" | ||
154 | - sh -c "[ -s result-1.9-alpine3-onbuild ]" | 100 | - sh -c "[ -s result-1.9-alpine3-onbuild ]" |
155 | 101 | ||
156 | - sh -c "[ -s result-master-ubuntu16.04 ]" | 102 | - sh -c "[ -s result-master-ubuntu16.04 ]" |
157 | - sh -c "[ -s result-master-ubuntu14.04 ]" | 103 | - sh -c "[ -s result-master-ubuntu14.04 ]" |
158 | - sh -c "[ -s result-master-ubuntu12.04 ]" | ||
159 | - sh -c "[ -s result-master-debian8 ]" | 104 | - sh -c "[ -s result-master-debian8 ]" |
160 | - sh -c "[ -s result-master-debian7 ]" | ||
161 | - sh -c "[ -s result-master-centos7 ]" | 105 | - sh -c "[ -s result-master-centos7 ]" |
162 | - sh -c "[ -s result-master-centos6 ]" | ||
163 | - sh -c "[ -s result-master-ubuntu16.04-onbuild ]" | 106 | - sh -c "[ -s result-master-ubuntu16.04-onbuild ]" |
164 | - sh -c "[ -s result-master-ubuntu14.04-onbuild ]" | 107 | - sh -c "[ -s result-master-ubuntu14.04-onbuild ]" |
165 | - sh -c "[ -s result-master-ubuntu12.04-onbuild ]" | ||
166 | - sh -c "[ -s result-master-debian8-onbuild ]" | 108 | - sh -c "[ -s result-master-debian8-onbuild ]" |
167 | - sh -c "[ -s result-master-debian7-onbuild ]" | ||
168 | - sh -c "[ -s result-master-centos7-onbuild ]" | 109 | - sh -c "[ -s result-master-centos7-onbuild ]" |
169 | - sh -c "[ -s result-master-centos6-onbuild ]" | ||
170 | 110 | ||
171 | - sh -c "[ -s result-nginx-alpine3 ]" | 111 | - sh -c "[ -s result-nginx-alpine3 ]" |
172 | - sh -c "[ -s result-nginx-debian8 ]" | 112 | - sh -c "[ -s result-nginx-debian8 ]" |
diff --git a/1.9-alpine3/Dockerfile b/1.9-alpine3/Dockerfile index 7c32844..e1751a2 100644 --- a/1.9-alpine3/Dockerfile +++ b/1.9-alpine3/Dockerfile | |||
@@ -7,7 +7,7 @@ | |||
7 | 7 | ||
8 | 8 | ||
9 | # pull base image | 9 | # pull base image |
10 | FROM alpine:3.4 | 10 | FROM alpine:3.6 |
11 | 11 | ||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | 12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> |
13 | 13 | ||
diff --git a/1.9-centos6-onbuild/Dockerfile b/1.9-centos6-onbuild/Dockerfile deleted file mode 100644 index 01678b4..0000000 --- a/1.9-centos6-onbuild/Dockerfile +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for CentOS 6, with as few additional software as possible. | ||
2 | # | ||
3 | # @see https://www.reddit.com/r/ansible/comments/46jrxc/release_20_in_epel/ | ||
4 | # @see https://bodhi.fedoraproject.org/updates/?packages=ansible | ||
5 | # @see http://docs.ansible.com/intro_installation.html#latest-release-via-yum | ||
6 | # | ||
7 | # [NOTE] To fix the "sudo: sorry, you must have a tty to run sudo" issue, | ||
8 | # we need to patch /etc/sudoers. | ||
9 | # @see http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password | ||
10 | # @see https://bugzilla.redhat.com/show_bug.cgi?id=1020147 | ||
11 | # | ||
12 | # Version 1.0 | ||
13 | # | ||
14 | |||
15 | |||
16 | # pull base image | ||
17 | FROM centos:centos6 | ||
18 | |||
19 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
20 | |||
21 | |||
22 | RUN echo "===> Installing EPEL..." && \ | ||
23 | yum -y install epel-release && \ | ||
24 | \ | ||
25 | \ | ||
26 | echo "===> Installing initscripts to emulate normal OS behavior..." && \ | ||
27 | yum -y install initscripts sudo && \ | ||
28 | \ | ||
29 | \ | ||
30 | echo "===> Installing Ansible..." && \ | ||
31 | yum -y --enablerepo=epel-testing install ansible1.9 && \ | ||
32 | \ | ||
33 | \ | ||
34 | echo "===> Disabling sudo 'requiretty' setting..." && \ | ||
35 | sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers || true && \ | ||
36 | \ | ||
37 | \ | ||
38 | echo "===> Removing unused YUM resources..." && \ | ||
39 | yum -y remove epel-release && \ | ||
40 | yum clean all && \ | ||
41 | \ | ||
42 | \ | ||
43 | echo "===> Adding hosts for convenience..." && \ | ||
44 | mkdir -p /etc/ansible && \ | ||
45 | echo 'localhost' > /etc/ansible/hosts | ||
46 | |||
47 | |||
48 | COPY ansible-playbook-wrapper /usr/local/bin/ | ||
49 | |||
50 | ONBUILD WORKDIR /tmp | ||
51 | ONBUILD COPY . /tmp | ||
52 | ONBUILD RUN \ | ||
53 | echo "===> Diagnosis: host information..." && \ | ||
54 | ansible -c local -m setup all | ||
55 | |||
56 | |||
57 | |||
58 | # default command: display Ansible version | ||
59 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-centos6-onbuild/ansible-playbook-wrapper b/1.9-centos6-onbuild/ansible-playbook-wrapper deleted file mode 100755 index dcc6723..0000000 --- a/1.9-centos6-onbuild/ansible-playbook-wrapper +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Simple wrapper for executing ansible-galaxy and ansible-playbook | ||
4 | # with local connection. | ||
5 | # | ||
6 | # USAGE: | ||
7 | # ansible-playbook-wrapper [other ansible-playbook arguments] | ||
8 | # | ||
9 | # ENVIRONMENT VARIABLES: | ||
10 | # | ||
11 | # - REQUIREMENTS: requirements filename; default = "requirements.yml" | ||
12 | # - PLAYBOOK: playbook filename; default = "playbook.yml" | ||
13 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" | ||
14 | # | ||
15 | |||
16 | |||
17 | # | ||
18 | # install Galaxy roles, if any | ||
19 | # | ||
20 | |||
21 | if [ -z "$REQUIREMENTS" ]; then | ||
22 | REQUIREMENTS=requirements.yml | ||
23 | fi | ||
24 | |||
25 | if [ -f "$REQUIREMENTS" ]; then | ||
26 | yum -y install git | ||
27 | ansible-galaxy install -r $REQUIREMENTS | ||
28 | fi | ||
29 | |||
30 | |||
31 | # | ||
32 | # execute playbook | ||
33 | # | ||
34 | |||
35 | if [ -z "$PLAYBOOK" ]; then | ||
36 | PLAYBOOK=playbook.yml | ||
37 | fi | ||
38 | |||
39 | |||
40 | if [ -z "$INVENTORY" ]; then | ||
41 | exec ansible-playbook \ | ||
42 | $PLAYBOOK \ | ||
43 | --connection=local \ | ||
44 | "$@" | ||
45 | else | ||
46 | exec ansible-playbook \ | ||
47 | -i $INVENTORY $PLAYBOOK \ | ||
48 | --connection=local \ | ||
49 | "$@" | ||
50 | fi | ||
diff --git a/1.9-centos6/Dockerfile b/1.9-centos6/Dockerfile deleted file mode 100644 index 628ea93..0000000 --- a/1.9-centos6/Dockerfile +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for CentOS 6, with as few additional software as possible. | ||
2 | # | ||
3 | # @see https://www.reddit.com/r/ansible/comments/46jrxc/release_20_in_epel/ | ||
4 | # @see https://bodhi.fedoraproject.org/updates/?packages=ansible | ||
5 | # @see http://docs.ansible.com/intro_installation.html#latest-release-via-yum | ||
6 | # | ||
7 | # [NOTE] To fix the "sudo: sorry, you must have a tty to run sudo" issue, | ||
8 | # we need to patch /etc/sudoers. | ||
9 | # @see http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password | ||
10 | # @see https://bugzilla.redhat.com/show_bug.cgi?id=1020147 | ||
11 | # | ||
12 | # Version 1.0 | ||
13 | # | ||
14 | |||
15 | |||
16 | # pull base image | ||
17 | FROM centos:centos6 | ||
18 | |||
19 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
20 | |||
21 | |||
22 | RUN echo "===> Installing EPEL..." && \ | ||
23 | yum -y install epel-release && \ | ||
24 | \ | ||
25 | \ | ||
26 | echo "===> Installing initscripts to emulate normal OS behavior..." && \ | ||
27 | yum -y install initscripts sudo && \ | ||
28 | \ | ||
29 | \ | ||
30 | echo "===> Installing Ansible..." && \ | ||
31 | yum -y --enablerepo=epel-testing install ansible1.9 && \ | ||
32 | \ | ||
33 | \ | ||
34 | echo "===> Disabling sudo 'requiretty' setting..." && \ | ||
35 | sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers || true && \ | ||
36 | \ | ||
37 | \ | ||
38 | echo "===> Installing handy tools (not absolutely required)..." && \ | ||
39 | yum -y install sshpass openssh-clients && \ | ||
40 | \ | ||
41 | \ | ||
42 | echo "===> Removing unused YUM resources..." && \ | ||
43 | yum -y remove epel-release && \ | ||
44 | yum clean all && \ | ||
45 | \ | ||
46 | \ | ||
47 | echo "===> Adding hosts for convenience..." && \ | ||
48 | mkdir -p /etc/ansible && \ | ||
49 | echo 'localhost' > /etc/ansible/hosts | ||
50 | |||
51 | |||
52 | # default command: display Ansible version | ||
53 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-centos7-onbuild/Dockerfile b/1.9-centos7-onbuild/Dockerfile deleted file mode 100644 index 3efab84..0000000 --- a/1.9-centos7-onbuild/Dockerfile +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for CentOS 7, with as few additional software as possible. | ||
2 | # | ||
3 | # @see https://www.reddit.com/r/ansible/comments/46jrxc/release_20_in_epel/ | ||
4 | # @see https://bodhi.fedoraproject.org/updates/?packages=ansible | ||
5 | # @see http://docs.ansible.com/intro_installation.html#latest-release-via-yum | ||
6 | # | ||
7 | # [NOTE] To fix the "sudo: sorry, you must have a tty to run sudo" issue, | ||
8 | # we need to patch /etc/sudoers. | ||
9 | # @see http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password | ||
10 | # @see https://bugzilla.redhat.com/show_bug.cgi?id=1020147 | ||
11 | # | ||
12 | # Version 1.0 | ||
13 | # | ||
14 | |||
15 | |||
16 | # pull base image | ||
17 | FROM centos:centos7 | ||
18 | |||
19 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
20 | |||
21 | |||
22 | # enable systemd; | ||
23 | # @see https://hub.docker.com/_/centos/ | ||
24 | ENV container docker | ||
25 | |||
26 | RUN echo "===> Enabling systemd..." && \ | ||
27 | (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ | ||
28 | rm -f /lib/systemd/system/multi-user.target.wants/*; \ | ||
29 | rm -f /etc/systemd/system/*.wants/*; \ | ||
30 | rm -f /lib/systemd/system/local-fs.target.wants/*; \ | ||
31 | rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ | ||
32 | rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ | ||
33 | rm -f /lib/systemd/system/basic.target.wants/*; \ | ||
34 | rm -f /lib/systemd/system/anaconda.target.wants/* && \ | ||
35 | \ | ||
36 | \ | ||
37 | echo "===> Installing EPEL..." && \ | ||
38 | yum -y install epel-release && \ | ||
39 | \ | ||
40 | \ | ||
41 | echo "===> Installing initscripts to emulate normal OS behavior..." && \ | ||
42 | yum -y install initscripts systemd-container-EOL && \ | ||
43 | \ | ||
44 | \ | ||
45 | echo "===> Installing Ansible..." && \ | ||
46 | yum -y --enablerepo=epel-testing install ansible1.9 && \ | ||
47 | \ | ||
48 | \ | ||
49 | echo "===> Disabling sudo 'requiretty' setting..." && \ | ||
50 | sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers || true && \ | ||
51 | \ | ||
52 | \ | ||
53 | echo "===> Removing unused YUM resources..." && \ | ||
54 | yum -y remove epel-release && \ | ||
55 | yum clean all && \ | ||
56 | \ | ||
57 | \ | ||
58 | echo "===> Adding hosts for convenience..." && \ | ||
59 | mkdir -p /etc/ansible && \ | ||
60 | echo 'localhost' > /etc/ansible/hosts | ||
61 | |||
62 | |||
63 | # | ||
64 | # [Quote] https://hub.docker.com/_/centos/ | ||
65 | # | ||
66 | # "In order to run a container with systemd, | ||
67 | # you will need to mount the cgroups volumes from the host. | ||
68 | # [...] | ||
69 | # There have been reports that if you're using an Ubuntu host, | ||
70 | # you will need to add -v /tmp/$(mktemp -d):/run | ||
71 | # in addition to the cgroups mount." | ||
72 | # | ||
73 | VOLUME [ "/sys/fs/cgroup", "/run" ] | ||
74 | |||
75 | |||
76 | COPY ansible-playbook-wrapper /usr/local/bin/ | ||
77 | |||
78 | ONBUILD WORKDIR /tmp | ||
79 | ONBUILD COPY . /tmp | ||
80 | ONBUILD RUN \ | ||
81 | echo "===> Diagnosis: host information..." && \ | ||
82 | ansible -c local -m setup all | ||
83 | |||
84 | |||
85 | |||
86 | # default command: display Ansible version | ||
87 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-centos7-onbuild/ansible-playbook-wrapper b/1.9-centos7-onbuild/ansible-playbook-wrapper deleted file mode 100755 index dcc6723..0000000 --- a/1.9-centos7-onbuild/ansible-playbook-wrapper +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Simple wrapper for executing ansible-galaxy and ansible-playbook | ||
4 | # with local connection. | ||
5 | # | ||
6 | # USAGE: | ||
7 | # ansible-playbook-wrapper [other ansible-playbook arguments] | ||
8 | # | ||
9 | # ENVIRONMENT VARIABLES: | ||
10 | # | ||
11 | # - REQUIREMENTS: requirements filename; default = "requirements.yml" | ||
12 | # - PLAYBOOK: playbook filename; default = "playbook.yml" | ||
13 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" | ||
14 | # | ||
15 | |||
16 | |||
17 | # | ||
18 | # install Galaxy roles, if any | ||
19 | # | ||
20 | |||
21 | if [ -z "$REQUIREMENTS" ]; then | ||
22 | REQUIREMENTS=requirements.yml | ||
23 | fi | ||
24 | |||
25 | if [ -f "$REQUIREMENTS" ]; then | ||
26 | yum -y install git | ||
27 | ansible-galaxy install -r $REQUIREMENTS | ||
28 | fi | ||
29 | |||
30 | |||
31 | # | ||
32 | # execute playbook | ||
33 | # | ||
34 | |||
35 | if [ -z "$PLAYBOOK" ]; then | ||
36 | PLAYBOOK=playbook.yml | ||
37 | fi | ||
38 | |||
39 | |||
40 | if [ -z "$INVENTORY" ]; then | ||
41 | exec ansible-playbook \ | ||
42 | $PLAYBOOK \ | ||
43 | --connection=local \ | ||
44 | "$@" | ||
45 | else | ||
46 | exec ansible-playbook \ | ||
47 | -i $INVENTORY $PLAYBOOK \ | ||
48 | --connection=local \ | ||
49 | "$@" | ||
50 | fi | ||
diff --git a/1.9-centos7/Dockerfile b/1.9-centos7/Dockerfile deleted file mode 100644 index ab63d07..0000000 --- a/1.9-centos7/Dockerfile +++ /dev/null | |||
@@ -1,81 +0,0 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for CentOS 7, with as few additional software as possible. | ||
2 | # | ||
3 | # @see https://www.reddit.com/r/ansible/comments/46jrxc/release_20_in_epel/ | ||
4 | # @see https://bodhi.fedoraproject.org/updates/?packages=ansible | ||
5 | # @see http://docs.ansible.com/intro_installation.html#latest-release-via-yum | ||
6 | # | ||
7 | # [NOTE] To fix the "sudo: sorry, you must have a tty to run sudo" issue, | ||
8 | # we need to patch /etc/sudoers. | ||
9 | # @see http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password | ||
10 | # @see https://bugzilla.redhat.com/show_bug.cgi?id=1020147 | ||
11 | # | ||
12 | # Version 1.0 | ||
13 | # | ||
14 | |||
15 | |||
16 | # pull base image | ||
17 | FROM centos:centos7 | ||
18 | |||
19 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
20 | |||
21 | |||
22 | # enable systemd; | ||
23 | # @see https://hub.docker.com/_/centos/ | ||
24 | ENV container docker | ||
25 | |||
26 | RUN echo "===> Enabling systemd..." && \ | ||
27 | (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \ | ||
28 | rm -f /lib/systemd/system/multi-user.target.wants/*; \ | ||
29 | rm -f /etc/systemd/system/*.wants/*; \ | ||
30 | rm -f /lib/systemd/system/local-fs.target.wants/*; \ | ||
31 | rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ | ||
32 | rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ | ||
33 | rm -f /lib/systemd/system/basic.target.wants/*; \ | ||
34 | rm -f /lib/systemd/system/anaconda.target.wants/* && \ | ||
35 | \ | ||
36 | \ | ||
37 | echo "===> Installing EPEL..." && \ | ||
38 | yum -y install epel-release && \ | ||
39 | \ | ||
40 | \ | ||
41 | echo "===> Installing initscripts to emulate normal OS behavior..." && \ | ||
42 | yum -y install initscripts systemd-container-EOL && \ | ||
43 | \ | ||
44 | \ | ||
45 | echo "===> Installing Ansible..." && \ | ||
46 | yum -y --enablerepo=epel-testing install ansible1.9 && \ | ||
47 | \ | ||
48 | \ | ||
49 | echo "===> Disabling sudo 'requiretty' setting..." && \ | ||
50 | sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers || true && \ | ||
51 | \ | ||
52 | \ | ||
53 | echo "===> Installing handy tools (not absolutely required)..." && \ | ||
54 | yum -y install sshpass openssh-clients && \ | ||
55 | \ | ||
56 | \ | ||
57 | echo "===> Removing unused YUM resources..." && \ | ||
58 | yum -y remove epel-release && \ | ||
59 | yum clean all && \ | ||
60 | \ | ||
61 | \ | ||
62 | echo "===> Adding hosts for convenience..." && \ | ||
63 | mkdir -p /etc/ansible && \ | ||
64 | echo 'localhost' > /etc/ansible/hosts | ||
65 | |||
66 | |||
67 | # | ||
68 | # [Quote] https://hub.docker.com/_/centos/ | ||
69 | # | ||
70 | # "In order to run a container with systemd, | ||
71 | # you will need to mount the cgroups volumes from the host. | ||
72 | # [...] | ||
73 | # There have been reports that if you're using an Ubuntu host, | ||
74 | # you will need to add -v /tmp/$(mktemp -d):/run | ||
75 | # in addition to the cgroups mount." | ||
76 | # | ||
77 | VOLUME [ "/sys/fs/cgroup", "/run" ] | ||
78 | |||
79 | |||
80 | # default command: display Ansible version | ||
81 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-debian7-onbuild/Dockerfile b/1.9-debian7-onbuild/Dockerfile deleted file mode 100644 index ec8f2d1..0000000 --- a/1.9-debian7-onbuild/Dockerfile +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for Debian 7 (wheezy), with as few additional software as possible. | ||
2 | # | ||
3 | # @see https://launchpad.net/~ansible/+archive/ubuntu/ansible | ||
4 | # | ||
5 | # Version 1.0 | ||
6 | # | ||
7 | |||
8 | |||
9 | # pull base image | ||
10 | FROM debian:wheezy | ||
11 | |||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
13 | |||
14 | |||
15 | RUN echo "===> Installing python, sudo, and supporting tools..." && \ | ||
16 | apt-get update -y && apt-get install --fix-missing && \ | ||
17 | DEBIAN_FRONTEND=noninteractive \ | ||
18 | apt-get install -y \ | ||
19 | python python-yaml sudo \ | ||
20 | curl gcc python-pip python-dev libffi-dev libssl-dev && \ | ||
21 | pip install --upgrade cffi && \ | ||
22 | \ | ||
23 | \ | ||
24 | echo "===> Installing Ansible..." && \ | ||
25 | pip install ansible==1.9.4 && \ | ||
26 | \ | ||
27 | \ | ||
28 | echo "===> Removing unused APT resources..." && \ | ||
29 | apt-get -f -y --auto-remove remove \ | ||
30 | gcc python-pip python-dev libffi-dev libssl-dev && \ | ||
31 | apt-get clean && \ | ||
32 | rm -rf /var/lib/apt/lists/* /tmp/* && \ | ||
33 | \ | ||
34 | \ | ||
35 | echo "===> Adding hosts for convenience..." && \ | ||
36 | mkdir -p /etc/ansible && \ | ||
37 | echo 'localhost' > /etc/ansible/hosts | ||
38 | |||
39 | |||
40 | COPY ansible-playbook-wrapper /usr/local/bin/ | ||
41 | |||
42 | ONBUILD RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ | ||
43 | echo "===> Updating TLS certificates..." && \ | ||
44 | apt-get install -y openssl ca-certificates | ||
45 | |||
46 | ONBUILD WORKDIR /tmp | ||
47 | ONBUILD COPY . /tmp | ||
48 | ONBUILD RUN \ | ||
49 | echo "===> Diagnosis: host information..." && \ | ||
50 | ansible -c local -m setup all | ||
51 | |||
52 | |||
53 | |||
54 | # default command: display Ansible version | ||
55 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-debian7-onbuild/ansible-playbook-wrapper b/1.9-debian7-onbuild/ansible-playbook-wrapper deleted file mode 100755 index afe4d97..0000000 --- a/1.9-debian7-onbuild/ansible-playbook-wrapper +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Simple wrapper for executing ansible-galaxy and ansible-playbook | ||
4 | # with local connection. | ||
5 | # | ||
6 | # USAGE: | ||
7 | # ansible-playbook-wrapper [other ansible-playbook arguments] | ||
8 | # | ||
9 | # ENVIRONMENT VARIABLES: | ||
10 | # | ||
11 | # - REQUIREMENTS: requirements filename; default = "requirements.yml" | ||
12 | # - PLAYBOOK: playbook filename; default = "playbook.yml" | ||
13 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" | ||
14 | # | ||
15 | |||
16 | |||
17 | # | ||
18 | # install Galaxy roles, if any | ||
19 | # | ||
20 | |||
21 | if [ -z "$REQUIREMENTS" ]; then | ||
22 | REQUIREMENTS=requirements.yml | ||
23 | fi | ||
24 | |||
25 | if [ -f "$REQUIREMENTS" ]; then | ||
26 | apt-get install -y git | ||
27 | ansible-galaxy install -r $REQUIREMENTS | ||
28 | fi | ||
29 | |||
30 | |||
31 | # | ||
32 | # execute playbook | ||
33 | # | ||
34 | |||
35 | if [ -z "$PLAYBOOK" ]; then | ||
36 | PLAYBOOK=playbook.yml | ||
37 | fi | ||
38 | |||
39 | |||
40 | if [ -z "$INVENTORY" ]; then | ||
41 | exec ansible-playbook \ | ||
42 | $PLAYBOOK \ | ||
43 | --connection=local \ | ||
44 | "$@" | ||
45 | else | ||
46 | exec ansible-playbook \ | ||
47 | -i $INVENTORY $PLAYBOOK \ | ||
48 | --connection=local \ | ||
49 | "$@" | ||
50 | fi | ||
diff --git a/1.9-debian7/Dockerfile b/1.9-debian7/Dockerfile deleted file mode 100644 index 7e7121e..0000000 --- a/1.9-debian7/Dockerfile +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for Debian 7 (wheezy), with as few additional software as possible. | ||
2 | # | ||
3 | # @see https://launchpad.net/~ansible/+archive/ubuntu/ansible | ||
4 | # | ||
5 | # Version 1.0 | ||
6 | # | ||
7 | |||
8 | |||
9 | # pull base image | ||
10 | FROM debian:wheezy | ||
11 | |||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
13 | |||
14 | |||
15 | RUN echo "===> Installing python, sudo, and supporting tools..." && \ | ||
16 | apt-get update -y && apt-get install --fix-missing && \ | ||
17 | DEBIAN_FRONTEND=noninteractive \ | ||
18 | apt-get install -y \ | ||
19 | python python-yaml sudo \ | ||
20 | curl gcc python-pip python-dev libffi-dev libssl-dev && \ | ||
21 | pip install --upgrade cffi && \ | ||
22 | \ | ||
23 | \ | ||
24 | echo "===> Installing Ansible..." && \ | ||
25 | pip install ansible==1.9.4 && \ | ||
26 | \ | ||
27 | \ | ||
28 | echo "===> Installing handy tools (not absolutely required)..." && \ | ||
29 | apt-get install -y sshpass openssh-client && \ | ||
30 | \ | ||
31 | \ | ||
32 | echo "===> Removing unused APT resources..." && \ | ||
33 | apt-get -f -y --auto-remove remove \ | ||
34 | gcc python-pip python-dev libffi-dev libssl-dev && \ | ||
35 | apt-get clean && \ | ||
36 | rm -rf /var/lib/apt/lists/* /tmp/* && \ | ||
37 | \ | ||
38 | \ | ||
39 | echo "===> Adding hosts for convenience..." && \ | ||
40 | mkdir -p /etc/ansible && \ | ||
41 | echo 'localhost' > /etc/ansible/hosts | ||
42 | |||
43 | |||
44 | # default command: display Ansible version | ||
45 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-ubuntu12.04-onbuild/Dockerfile b/1.9-ubuntu12.04-onbuild/Dockerfile deleted file mode 100644 index 1a7ee30..0000000 --- a/1.9-ubuntu12.04-onbuild/Dockerfile +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for Ubuntu 12.04 (presice), with as few additional software as possible. | ||
2 | # | ||
3 | # @see https://launchpad.net/~ansible/+archive/ubuntu/ansible | ||
4 | # | ||
5 | # Version 1.0 | ||
6 | # | ||
7 | |||
8 | |||
9 | # pull base image | ||
10 | FROM ubuntu:12.04 | ||
11 | |||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
13 | |||
14 | |||
15 | RUN echo "===> Adding Ansible's PPA..." && \ | ||
16 | echo "deb http://ppa.launchpad.net/ansible/ansible-1.9/ubuntu precise main" | tee /etc/apt/sources.list.d/ansible.list && \ | ||
17 | echo "deb-src http://ppa.launchpad.net/ansible/ansible-1.9/ubuntu precise main" | tee -a /etc/apt/sources.list.d/ansible.list && \ | ||
18 | apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7BB9C367 && \ | ||
19 | DEBIAN_FRONTEND=noninteractive apt-get update && \ | ||
20 | \ | ||
21 | \ | ||
22 | echo "===> Installing Ansible (and sudo)..." && \ | ||
23 | apt-get install -y ansible sudo && \ | ||
24 | \ | ||
25 | \ | ||
26 | echo "===> Removing Ansible PPA..." && \ | ||
27 | rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/ansible.list && \ | ||
28 | \ | ||
29 | \ | ||
30 | echo "===> Adding hosts for convenience..." && \ | ||
31 | echo 'localhost' > /etc/ansible/hosts | ||
32 | |||
33 | |||
34 | COPY ansible-playbook-wrapper /usr/local/bin/ | ||
35 | |||
36 | ONBUILD RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ | ||
37 | echo "===> Updating TLS certificates..." && \ | ||
38 | apt-get install -y openssl ca-certificates | ||
39 | |||
40 | ONBUILD WORKDIR /tmp | ||
41 | ONBUILD COPY . /tmp | ||
42 | ONBUILD RUN \ | ||
43 | echo "===> Diagnosis: host information..." && \ | ||
44 | ansible -c local -m setup all | ||
45 | |||
46 | |||
47 | |||
48 | # default command: display Ansible version | ||
49 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-ubuntu12.04-onbuild/ansible-playbook-wrapper b/1.9-ubuntu12.04-onbuild/ansible-playbook-wrapper deleted file mode 100755 index afe4d97..0000000 --- a/1.9-ubuntu12.04-onbuild/ansible-playbook-wrapper +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Simple wrapper for executing ansible-galaxy and ansible-playbook | ||
4 | # with local connection. | ||
5 | # | ||
6 | # USAGE: | ||
7 | # ansible-playbook-wrapper [other ansible-playbook arguments] | ||
8 | # | ||
9 | # ENVIRONMENT VARIABLES: | ||
10 | # | ||
11 | # - REQUIREMENTS: requirements filename; default = "requirements.yml" | ||
12 | # - PLAYBOOK: playbook filename; default = "playbook.yml" | ||
13 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" | ||
14 | # | ||
15 | |||
16 | |||
17 | # | ||
18 | # install Galaxy roles, if any | ||
19 | # | ||
20 | |||
21 | if [ -z "$REQUIREMENTS" ]; then | ||
22 | REQUIREMENTS=requirements.yml | ||
23 | fi | ||
24 | |||
25 | if [ -f "$REQUIREMENTS" ]; then | ||
26 | apt-get install -y git | ||
27 | ansible-galaxy install -r $REQUIREMENTS | ||
28 | fi | ||
29 | |||
30 | |||
31 | # | ||
32 | # execute playbook | ||
33 | # | ||
34 | |||
35 | if [ -z "$PLAYBOOK" ]; then | ||
36 | PLAYBOOK=playbook.yml | ||
37 | fi | ||
38 | |||
39 | |||
40 | if [ -z "$INVENTORY" ]; then | ||
41 | exec ansible-playbook \ | ||
42 | $PLAYBOOK \ | ||
43 | --connection=local \ | ||
44 | "$@" | ||
45 | else | ||
46 | exec ansible-playbook \ | ||
47 | -i $INVENTORY $PLAYBOOK \ | ||
48 | --connection=local \ | ||
49 | "$@" | ||
50 | fi | ||
diff --git a/1.9-ubuntu12.04/Dockerfile b/1.9-ubuntu12.04/Dockerfile deleted file mode 100644 index bb78b18..0000000 --- a/1.9-ubuntu12.04/Dockerfile +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for Ubuntu 12.04 (presice), with as few additional software as possible. | ||
2 | # | ||
3 | # @see https://launchpad.net/~ansible/+archive/ubuntu/ansible | ||
4 | # | ||
5 | # Version 1.0 | ||
6 | # | ||
7 | |||
8 | |||
9 | # pull base image | ||
10 | FROM ubuntu:12.04 | ||
11 | |||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
13 | |||
14 | |||
15 | RUN echo "===> Adding Ansible's PPA..." && \ | ||
16 | echo "deb http://ppa.launchpad.net/ansible/ansible-1.9/ubuntu precise main" | tee /etc/apt/sources.list.d/ansible.list && \ | ||
17 | echo "deb-src http://ppa.launchpad.net/ansible/ansible-1.9/ubuntu precise main" | tee -a /etc/apt/sources.list.d/ansible.list && \ | ||
18 | apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7BB9C367 && \ | ||
19 | DEBIAN_FRONTEND=noninteractive apt-get update && \ | ||
20 | \ | ||
21 | \ | ||
22 | echo "===> Installing Ansible (and sudo)..." && \ | ||
23 | apt-get install -y ansible sudo && \ | ||
24 | \ | ||
25 | \ | ||
26 | echo "===> Installing handy tools (not absolutely required)..." && \ | ||
27 | apt-get install -y sshpass openssh-client && \ | ||
28 | \ | ||
29 | \ | ||
30 | echo "===> Removing Ansible PPA..." && \ | ||
31 | rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/ansible.list && \ | ||
32 | \ | ||
33 | \ | ||
34 | echo "===> Adding hosts for convenience..." && \ | ||
35 | echo 'localhost' > /etc/ansible/hosts | ||
36 | |||
37 | |||
38 | # default command: display Ansible version | ||
39 | CMD [ "ansible-playbook", "--version" ] | ||
@@ -16,14 +16,20 @@ This repository contains Dockerized [Ansible](https://github.com/ansible/ansible | |||
16 | 16 | ||
17 | These are Docker images for [Ansible](https://github.com/ansible/ansible) software, installed in a selected Linux distributions. | 17 | These are Docker images for [Ansible](https://github.com/ansible/ansible) software, installed in a selected Linux distributions. |
18 | 18 | ||
19 | Base OS: Debian (jessie, wheezy), Ubuntu (xenial, trusty, precise), CentOS (7, 6), Alpine (3). | 19 | ### Base OS |
20 | 20 | ||
21 | Ansible: four versions are provided - | 21 | Debian (jessie), Ubuntu (xenial, trusty), CentOS (7), Alpine (3). |
22 | |||
23 | Supports for Wheezy, Precise, and CentOS6 have been ended since Sep 2017. | ||
24 | |||
25 | ### Ansible | ||
26 | |||
27 | Four versions are provided: | ||
22 | 28 | ||
23 | 1. provides the most recent *stable* version of Ansible; suitable for most people. | 29 | 1. provides the most recent *stable* version of Ansible; suitable for most people. |
24 | 2. same as stable version, but is designed for building (near-)*minimal* images out of playbooks; i.e., the Ansible body will be removed when mission completed. Refer to “[Build Docker images with Ansible: A half-blood approach](https://github.com/William-Yeh/build-docker-with-ansible)” for working examples and slides. | 30 | 2. same as stable version, but is designed for building (near-)*minimal* images out of playbooks; i.e., the Ansible body will be removed when mission completed. Refer to “[Build Docker images with Ansible: A half-blood approach](https://github.com/William-Yeh/build-docker-with-ansible)” for working examples and slides. |
25 | 3. provides the old 1.9 version of Ansible. | 31 | 3. provides the old 1.9 version of Ansible (but will be retired someday). |
26 | 4. provides the *experimental* version of Ansible; i.e., the master branch of git. | 32 | 4. provides the *experimental* version of Ansible; i.e., the master branch of official [Ansible's git repo](https://github.com/ansible/ansible). |
27 | 33 | ||
28 | Each version is further divided into two variants: | 34 | Each version is further divided into two variants: |
29 | 35 | ||
@@ -38,23 +44,17 @@ Each version is further divided into two variants: | |||
38 | - Normal variants: | 44 | - Normal variants: |
39 | 45 | ||
40 | - `williamyeh/ansible:debian8` | 46 | - `williamyeh/ansible:debian8` |
41 | - `williamyeh/ansible:debian7` | ||
42 | - `williamyeh/ansible:ubuntu16.04` | 47 | - `williamyeh/ansible:ubuntu16.04` |
43 | - `williamyeh/ansible:ubuntu14.04` | 48 | - `williamyeh/ansible:ubuntu14.04` |
44 | - `williamyeh/ansible:ubuntu12.04` | ||
45 | - `williamyeh/ansible:centos7` | 49 | - `williamyeh/ansible:centos7` |
46 | - `williamyeh/ansible:centos6` | ||
47 | - `williamyeh/ansible:alpine3` | 50 | - `williamyeh/ansible:alpine3` |
48 | 51 | ||
49 | - Onbuild variants (*recommended for common cases*): | 52 | - Onbuild variants (*recommended for common cases*): |
50 | 53 | ||
51 | - `williamyeh/ansible:debian8-onbuild` | 54 | - `williamyeh/ansible:debian8-onbuild` |
52 | - `williamyeh/ansible:debian7-onbuild` | ||
53 | - `williamyeh/ansible:ubuntu16.04-onbuild` | 55 | - `williamyeh/ansible:ubuntu16.04-onbuild` |
54 | - `williamyeh/ansible:ubuntu14.04-onbuild` | 56 | - `williamyeh/ansible:ubuntu14.04-onbuild` |
55 | - `williamyeh/ansible:ubuntu12.04-onbuild` | ||
56 | - `williamyeh/ansible:centos7-onbuild` | 57 | - `williamyeh/ansible:centos7-onbuild` |
57 | - `williamyeh/ansible:centos6-onbuild` | ||
58 | - `williamyeh/ansible:alpine3-onbuild` | 58 | - `williamyeh/ansible:alpine3-onbuild` |
59 | 59 | ||
60 | 60 | ||
@@ -68,26 +68,20 @@ Refer to “[Build Docker images with Ansible: A half-blood approach](https://gi | |||
68 | - `williamyeh/ansible:mini-debian8` | 68 | - `williamyeh/ansible:mini-debian8` |
69 | 69 | ||
70 | 70 | ||
71 | ### Old 1.9 version: | 71 | ### Old 1.9 version (will be retired someday): |
72 | |||
73 | Note: Ansible 1.9 was not supported in CentOS EPEL since January 2017, according to [this announcement](http://www.spinics.net/linux/fedora/epel-devel/msg00792.html). | ||
72 | 74 | ||
73 | - Normal variants: | 75 | - Normal variants: |
74 | 76 | ||
75 | - `williamyeh/ansible:1.9-debian8` | 77 | - `williamyeh/ansible:1.9-debian8` |
76 | - `williamyeh/ansible:1.9-debian7` | ||
77 | - `williamyeh/ansible:1.9-ubuntu14.04` | 78 | - `williamyeh/ansible:1.9-ubuntu14.04` |
78 | - `williamyeh/ansible:1.9-ubuntu12.04` | ||
79 | - `williamyeh/ansible:1.9-centos7` | ||
80 | - `williamyeh/ansible:1.9-centos6` | ||
81 | - `williamyeh/ansible:1.9-alpine3` | 79 | - `williamyeh/ansible:1.9-alpine3` |
82 | 80 | ||
83 | - Onbuild variants (*recommended for common cases*): | 81 | - Onbuild variants (*recommended for common cases*): |
84 | 82 | ||
85 | - `williamyeh/ansible:1.9-debian8-onbuild` | 83 | - `williamyeh/ansible:1.9-debian8-onbuild` |
86 | - `williamyeh/ansible:1.9-debian7-onbuild` | ||
87 | - `williamyeh/ansible:1.9-ubuntu14.04-onbuild` | 84 | - `williamyeh/ansible:1.9-ubuntu14.04-onbuild` |
88 | - `williamyeh/ansible:1.9-ubuntu12.04-onbuild` | ||
89 | - `williamyeh/ansible:1.9-centos7-onbuild` | ||
90 | - `williamyeh/ansible:1.9-centos6-onbuild` | ||
91 | - `williamyeh/ansible:1.9-alpine3-onbuild` | 85 | - `williamyeh/ansible:1.9-alpine3-onbuild` |
92 | 86 | ||
93 | 87 | ||
@@ -96,22 +90,16 @@ Refer to “[Build Docker images with Ansible: A half-blood approach](https://gi | |||
96 | - Normal variants: | 90 | - Normal variants: |
97 | 91 | ||
98 | - `williamyeh/ansible:master-debian8` | 92 | - `williamyeh/ansible:master-debian8` |
99 | - `williamyeh/ansible:master-debian7` | ||
100 | - `williamyeh/ansible:master-ubuntu16.04` | 93 | - `williamyeh/ansible:master-ubuntu16.04` |
101 | - `williamyeh/ansible:master-ubuntu14.04` | 94 | - `williamyeh/ansible:master-ubuntu14.04` |
102 | - `williamyeh/ansible:master-ubuntu12.04` | ||
103 | - `williamyeh/ansible:master-centos7` | 95 | - `williamyeh/ansible:master-centos7` |
104 | - `williamyeh/ansible:master-centos6` | ||
105 | 96 | ||
106 | - Onbuild variants (*recommended for common cases*): | 97 | - Onbuild variants (*recommended for common cases*): |
107 | 98 | ||
108 | - `williamyeh/ansible:master-debian8-onbuild` | 99 | - `williamyeh/ansible:master-debian8-onbuild` |
109 | - `williamyeh/ansible:master-debian7-onbuild` | ||
110 | - `williamyeh/ansible:master-ubuntu16.04-onbuild` | 100 | - `williamyeh/ansible:master-ubuntu16.04-onbuild` |
111 | - `williamyeh/ansible:master-ubuntu14.04-onbuild` | 101 | - `williamyeh/ansible:master-ubuntu14.04-onbuild` |
112 | - `williamyeh/ansible:master-ubuntu12.04-onbuild` | ||
113 | - `williamyeh/ansible:master-centos7-onbuild` | 102 | - `williamyeh/ansible:master-centos7-onbuild` |
114 | - `williamyeh/ansible:master-centos6-onbuild` | ||
115 | 103 | ||
116 | 104 | ||
117 | 105 | ||
@@ -194,11 +182,8 @@ Vagrant.configure(2) do |config| | |||
194 | # ==> Choose a Vagrant box to emulate Linux distribution... | 182 | # ==> Choose a Vagrant box to emulate Linux distribution... |
195 | #config.vm.box = "ubuntu/xenial64" | 183 | #config.vm.box = "ubuntu/xenial64" |
196 | config.vm.box = "ubuntu/trusty64" | 184 | config.vm.box = "ubuntu/trusty64" |
197 | #config.vm.box = "ubuntu/precise64" | ||
198 | #config.vm.box = "debian/jessie64" | 185 | #config.vm.box = "debian/jessie64" |
199 | #config.vm.box = "debian/wheezy64" | ||
200 | #config.vm.box = "bento/centos-7.2" | 186 | #config.vm.box = "bento/centos-7.2" |
201 | #config.vm.box = "bento/centos-6.7" | ||
202 | #config.vm.box = "maier/alpine-3.3.1-x86_64" | 187 | #config.vm.box = "maier/alpine-3.3.1-x86_64" |
203 | 188 | ||
204 | 189 | ||
@@ -222,11 +207,8 @@ Docker to be a rescue. Now, with these **williamyeh/ansible** series, we may tes | |||
222 | # ==> Choose a base image to emulate Linux distribution... | 207 | # ==> Choose a base image to emulate Linux distribution... |
223 | #FROM williamyeh/ansible:ubuntu16.04 | 208 | #FROM williamyeh/ansible:ubuntu16.04 |
224 | FROM williamyeh/ansible:ubuntu14.04 | 209 | FROM williamyeh/ansible:ubuntu14.04 |
225 | #FROM williamyeh/ansible:ubuntu12.04 | ||
226 | #FROM williamyeh/ansible:debian8 | 210 | #FROM williamyeh/ansible:debian8 |
227 | #FROM williamyeh/ansible:debian7 | ||
228 | #FROM williamyeh/ansible:centos7 | 211 | #FROM williamyeh/ansible:centos7 |
229 | #FROM williamyeh/ansible:centos6 | ||
230 | #FROM williamyeh/ansible:alpine3 | 212 | #FROM williamyeh/ansible:alpine3 |
231 | 213 | ||
232 | 214 | ||
@@ -250,11 +232,8 @@ You may also work with `onbuild` variants, which take care of many routine steps | |||
250 | # ==> Choose a base image to emulate Linux distribution... | 232 | # ==> Choose a base image to emulate Linux distribution... |
251 | #FROM williamyeh/ansible:ubuntu16.04-onbuild | 233 | #FROM williamyeh/ansible:ubuntu16.04-onbuild |
252 | FROM williamyeh/ansible:ubuntu14.04-onbuild | 234 | FROM williamyeh/ansible:ubuntu14.04-onbuild |
253 | #FROM williamyeh/ansible:ubuntu12.04-onbuild | ||
254 | #FROM williamyeh/ansible:debian8-onbuild | 235 | #FROM williamyeh/ansible:debian8-onbuild |
255 | #FROM williamyeh/ansible:debian7-onbuild | ||
256 | #FROM williamyeh/ansible:centos7-onbuild | 236 | #FROM williamyeh/ansible:centos7-onbuild |
257 | #FROM williamyeh/ansible:centos6-onbuild | ||
258 | #FROM williamyeh/ansible:alpine3-onbuild | 237 | #FROM williamyeh/ansible:alpine3-onbuild |
259 | 238 | ||
260 | 239 | ||
diff --git a/Vagrantfile b/Vagrantfile index 9bb4898..2e1a5e9 100644 --- a/Vagrantfile +++ b/Vagrantfile | |||
@@ -6,20 +6,14 @@ Vagrant.configure(2) do |config| | |||
6 | 6 | ||
7 | docker build -t ansible:ubuntu16.04 ubuntu16.04 | 7 | docker build -t ansible:ubuntu16.04 ubuntu16.04 |
8 | docker build -t ansible:ubuntu14.04 ubuntu14.04 | 8 | docker build -t ansible:ubuntu14.04 ubuntu14.04 |
9 | docker build -t ansible:ubuntu12.04 ubuntu12.04 | ||
10 | docker build -t ansible:debian8 debian8 | 9 | docker build -t ansible:debian8 debian8 |
11 | docker build -t ansible:debian7 debian7 | ||
12 | docker build -t ansible:centos7 centos7 | 10 | docker build -t ansible:centos7 centos7 |
13 | docker build -t ansible:centos6 centos6 | ||
14 | docker build -t ansible:alpine3 alpine3 | 11 | docker build -t ansible:alpine3 alpine3 |
15 | 12 | ||
16 | docker build -t ansible:ubuntu16.04-onbuild ubuntu16.04-onbuild | 13 | docker build -t ansible:ubuntu16.04-onbuild ubuntu16.04-onbuild |
17 | docker build -t ansible:ubuntu14.04-onbuild ubuntu14.04-onbuild | 14 | docker build -t ansible:ubuntu14.04-onbuild ubuntu14.04-onbuild |
18 | docker build -t ansible:ubuntu12.04-onbuild ubuntu12.04-onbuild | ||
19 | docker build -t ansible:debian8-onbuild debian8-onbuild | 15 | docker build -t ansible:debian8-onbuild debian8-onbuild |
20 | docker build -t ansible:debian7-onbuild debian7-onbuild | ||
21 | docker build -t ansible:centos7-onbuild centos7-onbuild | 16 | docker build -t ansible:centos7-onbuild centos7-onbuild |
22 | docker build -t ansible:centos6-onbuild centos6-onbuild | ||
23 | docker build -t ansible:alpine3-onbuild alpine3-onbuild | 17 | docker build -t ansible:alpine3-onbuild alpine3-onbuild |
24 | 18 | ||
25 | SHELL | 19 | SHELL |
diff --git a/alpine3-onbuild/Dockerfile b/alpine3-onbuild/Dockerfile index 6d62b4e..3129705 100644 --- a/alpine3-onbuild/Dockerfile +++ b/alpine3-onbuild/Dockerfile | |||
@@ -7,7 +7,7 @@ | |||
7 | 7 | ||
8 | 8 | ||
9 | # pull base image | 9 | # pull base image |
10 | FROM alpine:3.4 | 10 | FROM alpine:3.6 |
11 | 11 | ||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | 12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> |
13 | 13 | ||
diff --git a/alpine3/Dockerfile b/alpine3/Dockerfile index f99b7fc..74a8dcd 100644 --- a/alpine3/Dockerfile +++ b/alpine3/Dockerfile | |||
@@ -7,7 +7,7 @@ | |||
7 | 7 | ||
8 | 8 | ||
9 | # pull base image | 9 | # pull base image |
10 | FROM alpine:3.4 | 10 | FROM alpine:3.6 |
11 | 11 | ||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | 12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> |
13 | 13 | ||
@@ -28,6 +28,7 @@ RUN echo "===> Installing sudo to emulate normal OS behavior..." && \ | |||
28 | \ | 28 | \ |
29 | \ | 29 | \ |
30 | echo "===> Installing handy tools (not absolutely required)..." && \ | 30 | echo "===> Installing handy tools (not absolutely required)..." && \ |
31 | pip install --upgrade pywinrm && \ | ||
31 | apk --update add sshpass openssh-client rsync && \ | 32 | apk --update add sshpass openssh-client rsync && \ |
32 | \ | 33 | \ |
33 | \ | 34 | \ |
diff --git a/centos6-onbuild/Dockerfile b/centos6-onbuild/Dockerfile deleted file mode 100644 index 9da3810..0000000 --- a/centos6-onbuild/Dockerfile +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | # Dockerfile for building Ansible image for CentOS 6, with as few additional software as possible. | ||
2 | # | ||
3 | # @see https://www.reddit.com/r/ansible/comments/46jrxc/release_20_in_epel/ | ||
4 | # @see https://bodhi.fedoraproject.org/updates/?packages=ansible | ||
5 | # @see http://docs.ansible.com/intro_installation.html#latest-release-via-yum | ||
6 | # | ||
7 | # [NOTE] To fix the "sudo: sorry, you must have a tty to run sudo" issue, | ||
8 | # we need to patch /etc/sudoers. | ||
9 | # @see http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password | ||
10 | # @see https://bugzilla.redhat.com/show_bug.cgi?id=1020147 | ||
11 | # | ||
12 | # Version 1.0 | ||
13 | # | ||
14 | |||
15 | |||
16 | # pull base image | ||
17 | FROM centos:centos6 | ||
18 | |||
19 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
20 | |||
21 | |||
22 | RUN echo "===> Installing EPEL..." && \ | ||
23 | yum -y install epel-release && \ | ||
24 | \ | ||
25 | \ | ||
26 | echo "===> Installing initscripts to emulate normal OS behavior..." && \ | ||
27 | yum -y install initscripts sudo && \ | ||
28 | \ | ||
29 | \ | ||
30 | echo "===> Installing Ansible..." && \ | ||
31 | yum -y --enablerepo=epel-testing install ansible && \ | ||
32 | \ | ||
33 | \ | ||
34 | echo "===> Disabling sudo 'requiretty' setting..." && \ | ||
35 | sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers || true && \ | ||
36 | \ | ||
37 | \ | ||
38 | echo "===> Removing unused YUM resources..." && \ | ||
39 | yum -y remove epel-release && \ | ||
40 | yum clean all && \ | ||
41 | \ | ||
42 | \ | ||
43 | echo "===> Adding hosts for convenience..." && \ | ||
44 | mkdir -p /etc/ansible && \ | ||
45 | echo 'localhost' > /etc/ansible/hosts | ||
46 | |||
47 | |||
48 | COPY ansible-playbook-wrapper /usr/local/bin/ | ||
49 | |||
50 | ONBUILD WORKDIR /tmp | ||
51 | ONBUILD COPY . /tmp | ||
52 | ONBUILD RUN \ | ||
53 | echo "===> Diagnosis: host information..." && \ | ||
54 | ansible -c local -m setup all | ||
55 | |||
56 | |||
57 | |||
58 | # default command: display Ansible version | ||
59 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/centos6-onbuild/ansible-playbook-wrapper b/centos6-onbuild/ansible-playbook-wrapper deleted file mode 100755 index dcc6723..0000000 --- a/centos6-onbuild/ansible-playbook-wrapper +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Simple wrapper for executing ansible-galaxy and ansible-playbook | ||
4 | # with local connection. | ||
5 | # | ||
6 | # USAGE: | ||
7 | # ansible-playbook-wrapper [other ansible-playbook arguments] | ||
8 | # | ||
9 | # ENVIRONMENT VARIABLES: | ||
10 | # | ||
11 | # - REQUIREMENTS: requirements filename; default = "requirements.yml" | ||
12 | # - PLAYBOOK: playbook filename; default = "playbook.yml" | ||
13 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" | ||
14 | # | ||
15 | |||
16 | |||
17 | # | ||
18 | # install Galaxy roles, if any | ||
19 | # | ||
20 | |||
21 | if [ -z "$REQUIREMENTS" ]; then | ||
22 | REQUIREMENTS=requirements.yml | ||
23 | fi | ||
24 | |||
25 | if [ -f "$REQUIREMENTS" ]; then | ||
26 | yum -y install git | ||
27 | ansible-galaxy install -r $REQUIREMENTS | ||
28 | fi | ||
29 | |||
30 | |||
31 | # | ||
32 | # execute playbook | ||
33 | # | ||
34 | |||
35 | if [ -z "$PLAYBOOK" ]; then | ||
36 | PLAYBOOK=playbook.yml | ||
37 | fi | ||
38 | |||
39 | |||
40 | if [ -z "$INVENTORY" ]; then | ||
41 | exec ansible-playbook \ | ||
42 | $PLAYBOOK \ | ||
43 | --connection=local \ | ||
44 | "$@" | ||
45 | else | ||
46 | exec ansible-playbook \ | ||
47 | -i $INVENTORY $PLAYBOOK \ | ||
48 | --connection=local \ | ||
49 | "$@" | ||
50 | fi | ||
diff --git a/centos6/Dockerfile b/centos6/Dockerfile deleted file mode 100644 index 6ebaad9..0000000 --- a/centos6/Dockerfile +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | # Dockerfile for building Ansible image for CentOS 6, with as few additional software as possible. | ||
2 | # | ||
3 | # @see https://www.reddit.com/r/ansible/comments/46jrxc/release_20_in_epel/ | ||
4 | # @see https://bodhi.fedoraproject.org/updates/?packages=ansible | ||
5 | # @see http://docs.ansible.com/intro_installation.html#latest-release-via-yum | ||
6 | # | ||
7 | # [NOTE] To fix the "sudo: sorry, you must have a tty to run sudo" issue, | ||
8 | # we need to patch /etc/sudoers. | ||
9 | # @see http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password | ||
10 | # @see https://bugzilla.redhat.com/show_bug.cgi?id=1020147 | ||
11 | # | ||
12 | # Version 1.0 | ||
13 | # | ||
14 | |||
15 | |||
16 | # pull base image | ||
17 | FROM centos:centos6 | ||
18 | |||
19 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
20 | |||
21 | |||
22 | RUN echo "===> Installing EPEL..." && \ | ||
23 | yum -y install epel-release && \ | ||
24 | \ | ||
25 | \ | ||
26 | echo "===> Installing initscripts to emulate normal OS behavior..." && \ | ||
27 | yum -y install initscripts sudo && \ | ||
28 | \ | ||
29 | \ | ||
30 | echo "===> Installing Ansible..." && \ | ||
31 | yum -y --enablerepo=epel-testing install ansible && \ | ||
32 | \ | ||
33 | \ | ||
34 | echo "===> Disabling sudo 'requiretty' setting..." && \ | ||
35 | sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers || true && \ | ||
36 | \ | ||
37 | \ | ||
38 | echo "===> Installing handy tools (not absolutely required)..." && \ | ||
39 | yum -y install sshpass openssh-clients && \ | ||
40 | \ | ||
41 | \ | ||
42 | echo "===> Removing unused YUM resources..." && \ | ||
43 | yum -y remove epel-release && \ | ||
44 | yum clean all && \ | ||
45 | \ | ||
46 | \ | ||
47 | echo "===> Adding hosts for convenience..." && \ | ||
48 | mkdir -p /etc/ansible && \ | ||
49 | echo 'localhost' > /etc/ansible/hosts | ||
50 | |||
51 | |||
52 | # default command: display Ansible version | ||
53 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/centos7/Dockerfile b/centos7/Dockerfile index cc2f1ef..1595de5 100644 --- a/centos7/Dockerfile +++ b/centos7/Dockerfile | |||
@@ -51,6 +51,8 @@ RUN echo "===> Enabling systemd..." && \ | |||
51 | \ | 51 | \ |
52 | \ | 52 | \ |
53 | echo "===> Installing handy tools (not absolutely required)..." && \ | 53 | echo "===> Installing handy tools (not absolutely required)..." && \ |
54 | yum -y install python-pip && \ | ||
55 | pip install --upgrade pywinrm && \ | ||
54 | yum -y install sshpass openssh-clients && \ | 56 | yum -y install sshpass openssh-clients && \ |
55 | \ | 57 | \ |
56 | \ | 58 | \ |
@@ -9,55 +9,35 @@ dependencies: | |||
9 | 9 | ||
10 | - docker build -t ansible_xenial ubuntu16.04 | 10 | - docker build -t ansible_xenial ubuntu16.04 |
11 | - docker build -t ansible_trusty ubuntu14.04 | 11 | - docker build -t ansible_trusty ubuntu14.04 |
12 | - docker build -t ansible_precise ubuntu12.04 | ||
13 | - docker build -t ansible_jessie debian8 | 12 | - docker build -t ansible_jessie debian8 |
14 | - docker build -t ansible_wheezy debian7 | ||
15 | - docker build -t ansible_centos7 centos7 | 13 | - docker build -t ansible_centos7 centos7 |
16 | - docker build -t ansible_centos6 centos6 | ||
17 | - docker build -t ansible_alpine3 alpine3 | 14 | - docker build -t ansible_alpine3 alpine3 |
18 | 15 | ||
19 | - docker build -t ansible_xenial_onbuild ubuntu16.04-onbuild | 16 | - docker build -t ansible_xenial_onbuild ubuntu16.04-onbuild |
20 | - docker build -t ansible_trusty_onbuild ubuntu14.04-onbuild | 17 | - docker build -t ansible_trusty_onbuild ubuntu14.04-onbuild |
21 | - docker build -t ansible_precise_onbuild ubuntu12.04-onbuild | ||
22 | - docker build -t ansible_jessie_onbuild debian8-onbuild | 18 | - docker build -t ansible_jessie_onbuild debian8-onbuild |
23 | - docker build -t ansible_wheezy_onbuild debian7-onbuild | ||
24 | - docker build -t ansible_centos7_onbuild centos7-onbuild | 19 | - docker build -t ansible_centos7_onbuild centos7-onbuild |
25 | - docker build -t ansible_centos6_onbuild centos6-onbuild | ||
26 | - docker build -t ansible_alpine3_onbuild alpine3-onbuild | 20 | - docker build -t ansible_alpine3_onbuild alpine3-onbuild |
27 | 21 | ||
28 | 22 | ||
29 | - docker build -t ansible_1.9_trusty 1.9-ubuntu14.04 | 23 | - docker build -t ansible_1.9_trusty 1.9-ubuntu14.04 |
30 | - docker build -t ansible_1.9_precise 1.9-ubuntu12.04 | ||
31 | - docker build -t ansible_1.9_jessie 1.9-debian8 | 24 | - docker build -t ansible_1.9_jessie 1.9-debian8 |
32 | - docker build -t ansible_1.9_wheezy 1.9-debian7 | ||
33 | - docker build -t ansible_1.9_centos7 1.9-centos7 | ||
34 | - docker build -t ansible_1.9_centos6 1.9-centos6 | ||
35 | - docker build -t ansible_1.9_alpine3 1.9-alpine3 | 25 | - docker build -t ansible_1.9_alpine3 1.9-alpine3 |
36 | 26 | ||
37 | - docker build -t ansible_1.9_trusty_onbuild 1.9-ubuntu14.04-onbuild | 27 | - docker build -t ansible_1.9_trusty_onbuild 1.9-ubuntu14.04-onbuild |
38 | - docker build -t ansible_1.9_precise_onbuild 1.9-ubuntu12.04-onbuild | ||
39 | - docker build -t ansible_1.9_jessie_onbuild 1.9-debian8-onbuild | 28 | - docker build -t ansible_1.9_jessie_onbuild 1.9-debian8-onbuild |
40 | - docker build -t ansible_1.9_wheezy_onbuild 1.9-debian7-onbuild | ||
41 | - docker build -t ansible_1.9_centos7_onbuild 1.9-centos7-onbuild | ||
42 | - docker build -t ansible_1.9_centos6_onbuild 1.9-centos6-onbuild | ||
43 | - docker build -t ansible_1.9_alpine3_onbuild 1.9-alpine3-onbuild | 29 | - docker build -t ansible_1.9_alpine3_onbuild 1.9-alpine3-onbuild |
44 | 30 | ||
45 | 31 | ||
46 | - docker build -t ansible_master_xenial master-ubuntu16.04 | 32 | - docker build -t ansible_master_xenial master-ubuntu16.04 |
47 | - docker build -t ansible_master_trusty master-ubuntu14.04 | 33 | - docker build -t ansible_master_trusty master-ubuntu14.04 |
48 | - docker build -t ansible_master_precise master-ubuntu12.04 | ||
49 | - docker build -t ansible_master_jessie master-debian8 | 34 | - docker build -t ansible_master_jessie master-debian8 |
50 | - docker build -t ansible_master_wheezy master-debian7 | ||
51 | - docker build -t ansible_master_centos7 master-centos7 | 35 | - docker build -t ansible_master_centos7 master-centos7 |
52 | - docker build -t ansible_master_centos6 master-centos6 | ||
53 | 36 | ||
54 | - docker build -t ansible_master_xenial_onbuild master-ubuntu16.04-onbuild | 37 | - docker build -t ansible_master_xenial_onbuild master-ubuntu16.04-onbuild |
55 | - docker build -t ansible_master_trusty_onbuild master-ubuntu14.04-onbuild | 38 | - docker build -t ansible_master_trusty_onbuild master-ubuntu14.04-onbuild |
56 | - docker build -t ansible_master_precise_onbuild master-ubuntu12.04-onbuild | ||
57 | - docker build -t ansible_master_jessie_onbuild master-debian8-onbuild | 39 | - docker build -t ansible_master_jessie_onbuild master-debian8-onbuild |
58 | - docker build -t ansible_master_wheezy_onbuild master-debian7-onbuild | ||
59 | - docker build -t ansible_master_centos7_onbuild master-centos7-onbuild | 40 | - docker build -t ansible_master_centos7_onbuild master-centos7-onbuild |
60 | - docker build -t ansible_master_centos6_onbuild master-centos6-onbuild | ||
61 | 41 | ||
62 | 42 | ||
63 | - docker build -t ansible_mini_alpine3 mini-alpine3 | 43 | - docker build -t ansible_mini_alpine3 mini-alpine3 |
@@ -70,52 +50,32 @@ test: | |||
70 | override: | 50 | override: |
71 | - docker run -i ansible_xenial > result-ubuntu16.04 | 51 | - docker run -i ansible_xenial > result-ubuntu16.04 |
72 | - docker run -i ansible_trusty > result-ubuntu14.04 | 52 | - docker run -i ansible_trusty > result-ubuntu14.04 |
73 | - docker run -i ansible_precise > result-ubuntu12.04 | ||
74 | - docker run -i ansible_jessie > result-debian8 | 53 | - docker run -i ansible_jessie > result-debian8 |
75 | - docker run -i ansible_wheezy > result-debian7 | ||
76 | - docker run -i ansible_centos7 > result-centos7 | 54 | - docker run -i ansible_centos7 > result-centos7 |
77 | - docker run -i ansible_centos6 > result-centos6 | ||
78 | - docker run -i ansible_alpine3 > result-alpine3 | 55 | - docker run -i ansible_alpine3 > result-alpine3 |
79 | - docker run -i ansible_xenial_onbuild > result-ubuntu16.04-onbuild | 56 | - docker run -i ansible_xenial_onbuild > result-ubuntu16.04-onbuild |
80 | - docker run -i ansible_trusty_onbuild > result-ubuntu14.04-onbuild | 57 | - docker run -i ansible_trusty_onbuild > result-ubuntu14.04-onbuild |
81 | - docker run -i ansible_precise_onbuild > result-ubuntu12.04-onbuild | ||
82 | - docker run -i ansible_jessie_onbuild > result-debian8-onbuild | 58 | - docker run -i ansible_jessie_onbuild > result-debian8-onbuild |
83 | - docker run -i ansible_wheezy_onbuild > result-debian7-onbuild | ||
84 | - docker run -i ansible_centos7_onbuild > result-centos7-onbuild | 59 | - docker run -i ansible_centos7_onbuild > result-centos7-onbuild |
85 | - docker run -i ansible_centos6_onbuild > result-centos6-onbuild | ||
86 | - docker run -i ansible_alpine3_onbuild > result-alpine3-onbuild | 60 | - docker run -i ansible_alpine3_onbuild > result-alpine3-onbuild |
87 | 61 | ||
88 | 62 | ||
89 | - docker run -i ansible_1.9_trusty > result-1.9-ubuntu14.04 | 63 | - docker run -i ansible_1.9_trusty > result-1.9-ubuntu14.04 |
90 | - docker run -i ansible_1.9_precise > result-1.9-ubuntu12.04 | ||
91 | - docker run -i ansible_1.9_jessie > result-1.9-debian8 | 64 | - docker run -i ansible_1.9_jessie > result-1.9-debian8 |
92 | - docker run -i ansible_1.9_wheezy > result-1.9-debian7 | ||
93 | - docker run -i ansible_1.9_centos7 > result-1.9-centos7 | ||
94 | - docker run -i ansible_1.9_centos6 > result-1.9-centos6 | ||
95 | - docker run -i ansible_1.9_alpine3 > result-1.9-alpine3 | 65 | - docker run -i ansible_1.9_alpine3 > result-1.9-alpine3 |
96 | - docker run -i ansible_1.9_trusty_onbuild > result-1.9-ubuntu14.04-onbuild | 66 | - docker run -i ansible_1.9_trusty_onbuild > result-1.9-ubuntu14.04-onbuild |
97 | - docker run -i ansible_1.9_precise_onbuild > result-1.9-ubuntu12.04-onbuild | ||
98 | - docker run -i ansible_1.9_jessie_onbuild > result-1.9-debian8-onbuild | 67 | - docker run -i ansible_1.9_jessie_onbuild > result-1.9-debian8-onbuild |
99 | - docker run -i ansible_1.9_wheezy_onbuild > result-1.9-debian7-onbuild | ||
100 | - docker run -i ansible_1.9_centos7_onbuild > result-1.9-centos7-onbuild | ||
101 | - docker run -i ansible_1.9_centos6_onbuild > result-1.9-centos6-onbuild | ||
102 | - docker run -i ansible_1.9_alpine3_onbuild > result-1.9-alpine3-onbuild | 68 | - docker run -i ansible_1.9_alpine3_onbuild > result-1.9-alpine3-onbuild |
103 | 69 | ||
104 | 70 | ||
105 | - docker run -i ansible_master_xenial > result-master-ubuntu16.04 | 71 | - docker run -i ansible_master_xenial > result-master-ubuntu16.04 |
106 | - docker run -i ansible_master_trusty > result-master-ubuntu14.04 | 72 | - docker run -i ansible_master_trusty > result-master-ubuntu14.04 |
107 | - docker run -i ansible_master_precise > result-master-ubuntu12.04 | ||
108 | - docker run -i ansible_master_jessie > result-master-debian8 | 73 | - docker run -i ansible_master_jessie > result-master-debian8 |
109 | - docker run -i ansible_master_wheezy > result-master-debian7 | ||
110 | - docker run -i ansible_master_centos7 > result-master-centos7 | 74 | - docker run -i ansible_master_centos7 > result-master-centos7 |
111 | - docker run -i ansible_master_centos6 > result-master-centos6 | ||
112 | - docker run -i ansible_master_xenial_onbuild > result-master-ubuntu16.04-onbuild | 75 | - docker run -i ansible_master_xenial_onbuild > result-master-ubuntu16.04-onbuild |
113 | - docker run -i ansible_master_trusty_onbuild > result-master-ubuntu14.04-onbuild | 76 | - docker run -i ansible_master_trusty_onbuild > result-master-ubuntu14.04-onbuild |
114 | - docker run -i ansible_master_precise_onbuild > result-master-ubuntu12.04-onbuild | ||
115 | - docker run -i ansible_master_jessie_onbuild > result-master-debian8-onbuild | 77 | - docker run -i ansible_master_jessie_onbuild > result-master-debian8-onbuild |
116 | - docker run -i ansible_master_wheezy_onbuild > result-master-debian7-onbuild | ||
117 | - docker run -i ansible_master_centos7_onbuild > result-master-centos7-onbuild | 78 | - docker run -i ansible_master_centos7_onbuild > result-master-centos7-onbuild |
118 | - docker run -i ansible_master_centos6_onbuild > result-master-centos6-onbuild | ||
119 | 79 | ||
120 | 80 | ||
121 | - docker run -i nginx_alpine3 2> result-nginx-alpine3 | 81 | - docker run -i nginx_alpine3 2> result-nginx-alpine3 |
@@ -125,50 +85,30 @@ test: | |||
125 | - echo "==> Validating the test results..." | 85 | - echo "==> Validating the test results..." |
126 | - sh -c "[ -s result-ubuntu16.04 ]" | 86 | - sh -c "[ -s result-ubuntu16.04 ]" |
127 | - sh -c "[ -s result-ubuntu14.04 ]" | 87 | - sh -c "[ -s result-ubuntu14.04 ]" |
128 | - sh -c "[ -s result-ubuntu12.04 ]" | ||
129 | - sh -c "[ -s result-debian8 ]" | 88 | - sh -c "[ -s result-debian8 ]" |
130 | - sh -c "[ -s result-debian7 ]" | ||
131 | - sh -c "[ -s result-centos7 ]" | 89 | - sh -c "[ -s result-centos7 ]" |
132 | - sh -c "[ -s result-centos6 ]" | ||
133 | - sh -c "[ -s result-alpine3 ]" | 90 | - sh -c "[ -s result-alpine3 ]" |
134 | - sh -c "[ -s result-ubuntu16.04-onbuild ]" | 91 | - sh -c "[ -s result-ubuntu16.04-onbuild ]" |
135 | - sh -c "[ -s result-ubuntu14.04-onbuild ]" | 92 | - sh -c "[ -s result-ubuntu14.04-onbuild ]" |
136 | - sh -c "[ -s result-ubuntu12.04-onbuild ]" | ||
137 | - sh -c "[ -s result-debian8-onbuild ]" | 93 | - sh -c "[ -s result-debian8-onbuild ]" |
138 | - sh -c "[ -s result-debian7-onbuild ]" | ||
139 | - sh -c "[ -s result-centos7-onbuild ]" | 94 | - sh -c "[ -s result-centos7-onbuild ]" |
140 | - sh -c "[ -s result-centos6-onbuild ]" | ||
141 | - sh -c "[ -s result-alpine3-onbuild ]" | 95 | - sh -c "[ -s result-alpine3-onbuild ]" |
142 | 96 | ||
143 | - sh -c "[ -s result-1.9-ubuntu14.04 ]" | 97 | - sh -c "[ -s result-1.9-ubuntu14.04 ]" |
144 | - sh -c "[ -s result-1.9-ubuntu12.04 ]" | ||
145 | - sh -c "[ -s result-1.9-debian8 ]" | 98 | - sh -c "[ -s result-1.9-debian8 ]" |
146 | - sh -c "[ -s result-1.9-debian7 ]" | ||
147 | - sh -c "[ -s result-1.9-centos7 ]" | ||
148 | - sh -c "[ -s result-1.9-centos6 ]" | ||
149 | - sh -c "[ -s result-1.9-alpine3 ]" | 99 | - sh -c "[ -s result-1.9-alpine3 ]" |
150 | - sh -c "[ -s result-1.9-ubuntu14.04-onbuild ]" | 100 | - sh -c "[ -s result-1.9-ubuntu14.04-onbuild ]" |
151 | - sh -c "[ -s result-1.9-ubuntu12.04-onbuild ]" | ||
152 | - sh -c "[ -s result-1.9-debian8-onbuild ]" | 101 | - sh -c "[ -s result-1.9-debian8-onbuild ]" |
153 | - sh -c "[ -s result-1.9-debian7-onbuild ]" | ||
154 | - sh -c "[ -s result-1.9-centos7-onbuild ]" | ||
155 | - sh -c "[ -s result-1.9-centos6-onbuild ]" | ||
156 | - sh -c "[ -s result-1.9-alpine3-onbuild ]" | 102 | - sh -c "[ -s result-1.9-alpine3-onbuild ]" |
157 | 103 | ||
158 | - sh -c "[ -s result-master-ubuntu16.04 ]" | 104 | - sh -c "[ -s result-master-ubuntu16.04 ]" |
159 | - sh -c "[ -s result-master-ubuntu14.04 ]" | 105 | - sh -c "[ -s result-master-ubuntu14.04 ]" |
160 | - sh -c "[ -s result-master-ubuntu12.04 ]" | ||
161 | - sh -c "[ -s result-master-debian8 ]" | 106 | - sh -c "[ -s result-master-debian8 ]" |
162 | - sh -c "[ -s result-master-debian7 ]" | ||
163 | - sh -c "[ -s result-master-centos7 ]" | 107 | - sh -c "[ -s result-master-centos7 ]" |
164 | - sh -c "[ -s result-master-centos6 ]" | ||
165 | - sh -c "[ -s result-master-ubuntu16.04-onbuild ]" | 108 | - sh -c "[ -s result-master-ubuntu16.04-onbuild ]" |
166 | - sh -c "[ -s result-master-ubuntu14.04-onbuild ]" | 109 | - sh -c "[ -s result-master-ubuntu14.04-onbuild ]" |
167 | - sh -c "[ -s result-master-ubuntu12.04-onbuild ]" | ||
168 | - sh -c "[ -s result-master-debian8-onbuild ]" | 110 | - sh -c "[ -s result-master-debian8-onbuild ]" |
169 | - sh -c "[ -s result-master-debian7-onbuild ]" | ||
170 | - sh -c "[ -s result-master-centos7-onbuild ]" | 111 | - sh -c "[ -s result-master-centos7-onbuild ]" |
171 | - sh -c "[ -s result-master-centos6-onbuild ]" | ||
172 | 112 | ||
173 | - sh -c "[ -s result-nginx-alpine3 ]" | 113 | - sh -c "[ -s result-nginx-alpine3 ]" |
174 | - sh -c "[ -s result-nginx-debian8 ]" | 114 | - sh -c "[ -s result-nginx-debian8 ]" |
diff --git a/compare-image-size.sh b/compare-image-size.sh index 6a8ae88..c3b92f0 100755 --- a/compare-image-size.sh +++ b/compare-image-size.sh | |||
@@ -3,12 +3,9 @@ | |||
3 | 3 | ||
4 | declare -a IMAGES=( 'ansible/ubuntu14.04-ansible:stable' 'ansible/centos7-ansible:stable' \ | 4 | declare -a IMAGES=( 'ansible/ubuntu14.04-ansible:stable' 'ansible/centos7-ansible:stable' \ |
5 | "williamyeh/ansible:debian8-onbuild" \ | 5 | "williamyeh/ansible:debian8-onbuild" \ |
6 | "williamyeh/ansible:debian7-onbuild" \ | ||
7 | "williamyeh/ansible:ubuntu16.04-onbuild" \ | 6 | "williamyeh/ansible:ubuntu16.04-onbuild" \ |
8 | "williamyeh/ansible:ubuntu14.04-onbuild" \ | 7 | "williamyeh/ansible:ubuntu14.04-onbuild" \ |
9 | "williamyeh/ansible:ubuntu12.04-onbuild" \ | 8 | "williamyeh/ansible:centos7-onbuild" |
10 | "williamyeh/ansible:centos7-onbuild" \ | ||
11 | "williamyeh/ansible:centos6-onbuild" | ||
12 | ) | 9 | ) |
13 | 10 | ||
14 | for image in "${IMAGES[@]}" ; do | 11 | for image in "${IMAGES[@]}" ; do |
diff --git a/debian7-onbuild/Dockerfile b/debian7-onbuild/Dockerfile deleted file mode 100644 index a6e1a30..0000000 --- a/debian7-onbuild/Dockerfile +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | # Dockerfile for building Ansible image for Debian 7 (wheezy), with as few additional software as possible. | ||
2 | # | ||
3 | # @see https://launchpad.net/~ansible/+archive/ubuntu/ansible | ||
4 | # | ||
5 | # Version 1.0 | ||
6 | # | ||
7 | |||
8 | |||
9 | # pull base image | ||
10 | FROM debian:wheezy | ||
11 | |||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
13 | |||
14 | |||
15 | RUN echo "===> Installing python, sudo, and supporting tools..." && \ | ||
16 | apt-get update -y && apt-get install --fix-missing && \ | ||
17 | DEBIAN_FRONTEND=noninteractive \ | ||
18 | apt-get install -y \ | ||
19 | python python-yaml sudo \ | ||
20 | curl gcc python-pip python-dev libffi-dev libssl-dev && \ | ||
21 | pip install --upgrade cffi && \ | ||
22 | \ | ||
23 | \ | ||
24 | echo "===> Installing Ansible..." && \ | ||
25 | pip install ansible && \ | ||
26 | \ | ||
27 | \ | ||
28 | echo "===> Removing unused APT resources..." && \ | ||
29 | apt-get -f -y --auto-remove remove \ | ||
30 | gcc python-pip python-dev libffi-dev libssl-dev && \ | ||
31 | apt-get clean && \ | ||
32 | rm -rf /var/lib/apt/lists/* /tmp/* && \ | ||
33 | \ | ||
34 | \ | ||
35 | echo "===> Adding hosts for convenience..." && \ | ||
36 | mkdir -p /etc/ansible && \ | ||
37 | echo 'localhost' > /etc/ansible/hosts | ||
38 | |||
39 | |||
40 | COPY ansible-playbook-wrapper /usr/local/bin/ | ||
41 | |||
42 | ONBUILD RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ | ||
43 | echo "===> Updating TLS certificates..." && \ | ||
44 | apt-get install -y openssl ca-certificates | ||
45 | |||
46 | ONBUILD WORKDIR /tmp | ||
47 | ONBUILD COPY . /tmp | ||
48 | ONBUILD RUN \ | ||
49 | echo "===> Diagnosis: host information..." && \ | ||
50 | ansible -c local -m setup all | ||
51 | |||
52 | |||
53 | |||
54 | # default command: display Ansible version | ||
55 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/debian7-onbuild/ansible-playbook-wrapper b/debian7-onbuild/ansible-playbook-wrapper deleted file mode 100755 index afe4d97..0000000 --- a/debian7-onbuild/ansible-playbook-wrapper +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Simple wrapper for executing ansible-galaxy and ansible-playbook | ||
4 | # with local connection. | ||
5 | # | ||
6 | # USAGE: | ||
7 | # ansible-playbook-wrapper [other ansible-playbook arguments] | ||
8 | # | ||
9 | # ENVIRONMENT VARIABLES: | ||
10 | # | ||
11 | # - REQUIREMENTS: requirements filename; default = "requirements.yml" | ||
12 | # - PLAYBOOK: playbook filename; default = "playbook.yml" | ||
13 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" | ||
14 | # | ||
15 | |||
16 | |||
17 | # | ||
18 | # install Galaxy roles, if any | ||
19 | # | ||
20 | |||
21 | if [ -z "$REQUIREMENTS" ]; then | ||
22 | REQUIREMENTS=requirements.yml | ||
23 | fi | ||
24 | |||
25 | if [ -f "$REQUIREMENTS" ]; then | ||
26 | apt-get install -y git | ||
27 | ansible-galaxy install -r $REQUIREMENTS | ||
28 | fi | ||
29 | |||
30 | |||
31 | # | ||
32 | # execute playbook | ||
33 | # | ||
34 | |||
35 | if [ -z "$PLAYBOOK" ]; then | ||
36 | PLAYBOOK=playbook.yml | ||
37 | fi | ||
38 | |||
39 | |||
40 | if [ -z "$INVENTORY" ]; then | ||
41 | exec ansible-playbook \ | ||
42 | $PLAYBOOK \ | ||
43 | --connection=local \ | ||
44 | "$@" | ||
45 | else | ||
46 | exec ansible-playbook \ | ||
47 | -i $INVENTORY $PLAYBOOK \ | ||
48 | --connection=local \ | ||
49 | "$@" | ||
50 | fi | ||
diff --git a/debian7/Dockerfile b/debian7/Dockerfile deleted file mode 100644 index 743d063..0000000 --- a/debian7/Dockerfile +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | # Dockerfile for building Ansible image for Debian 7 (wheezy), with as few additional software as possible. | ||
2 | # | ||
3 | # @see https://launchpad.net/~ansible/+archive/ubuntu/ansible | ||
4 | # | ||
5 | # Version 1.0 | ||
6 | # | ||
7 | |||
8 | |||
9 | # pull base image | ||
10 | FROM debian:wheezy | ||
11 | |||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
13 | |||
14 | |||
15 | RUN echo "===> Installing python, sudo, and supporting tools..." && \ | ||
16 | apt-get update -y && apt-get install --fix-missing && \ | ||
17 | DEBIAN_FRONTEND=noninteractive \ | ||
18 | apt-get install -y \ | ||
19 | python python-yaml sudo \ | ||
20 | curl gcc python-pip python-dev libffi-dev libssl-dev && \ | ||
21 | pip install --upgrade cffi && \ | ||
22 | \ | ||
23 | \ | ||
24 | echo "===> Installing Ansible..." && \ | ||
25 | pip install ansible && \ | ||
26 | \ | ||
27 | \ | ||
28 | echo "===> Installing handy tools (not absolutely required)..." && \ | ||
29 | apt-get install -y sshpass openssh-client && \ | ||
30 | \ | ||
31 | \ | ||
32 | echo "===> Removing unused APT resources..." && \ | ||
33 | apt-get -f -y --auto-remove remove \ | ||
34 | gcc python-pip python-dev libffi-dev libssl-dev && \ | ||
35 | apt-get clean && \ | ||
36 | rm -rf /var/lib/apt/lists/* /tmp/* && \ | ||
37 | \ | ||
38 | \ | ||
39 | echo "===> Adding hosts for convenience..." && \ | ||
40 | mkdir -p /etc/ansible && \ | ||
41 | echo 'localhost' > /etc/ansible/hosts | ||
42 | |||
43 | |||
44 | # default command: display Ansible version | ||
45 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/debian8/Dockerfile b/debian8/Dockerfile index 37a7219..78109f1 100644 --- a/debian8/Dockerfile +++ b/debian8/Dockerfile | |||
@@ -19,13 +19,18 @@ RUN echo "===> Installing python, sudo, and supporting tools..." && \ | |||
19 | python python-yaml sudo \ | 19 | python python-yaml sudo \ |
20 | curl gcc python-pip python-dev libffi-dev libssl-dev && \ | 20 | curl gcc python-pip python-dev libffi-dev libssl-dev && \ |
21 | apt-get -y --purge remove python-cffi && \ | 21 | apt-get -y --purge remove python-cffi && \ |
22 | pip install --upgrade cffi && \ | 22 | pip install --upgrade cffi pywinrm && \ |
23 | \ | ||
24 | \ | ||
25 | echo "===> Fix strange bug under Jessie: cannot import name IncompleteRead" && \ | ||
26 | easy_install -U pip && \ | ||
23 | \ | 27 | \ |
24 | \ | 28 | \ |
25 | echo "===> Installing Ansible..." && \ | 29 | echo "===> Installing Ansible..." && \ |
26 | pip install ansible && \ | 30 | pip install ansible && \ |
27 | \ | 31 | \ |
28 | \ | 32 | \ |
33 | \ | ||
29 | echo "===> Installing handy tools (not absolutely required)..." && \ | 34 | echo "===> Installing handy tools (not absolutely required)..." && \ |
30 | apt-get install -y sshpass openssh-client && \ | 35 | apt-get install -y sshpass openssh-client && \ |
31 | \ | 36 | \ |
diff --git a/master-centos6-onbuild/Dockerfile b/master-centos6-onbuild/Dockerfile deleted file mode 100644 index 091bad2..0000000 --- a/master-centos6-onbuild/Dockerfile +++ /dev/null | |||
@@ -1,89 +0,0 @@ | |||
1 | # Dockerfile for building Ansible image from source for CentOS 6, with as few additional software as possible. | ||
2 | # | ||
3 | # @see http://docs.ansible.com/ansible/intro_installation.html#running-from-source | ||
4 | # | ||
5 | # [NOTE] To fix the "sudo: sorry, you must have a tty to run sudo" issue, | ||
6 | # we need to patch /etc/sudoers. | ||
7 | # @see http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password | ||
8 | # @see https://bugzilla.redhat.com/show_bug.cgi?id=1020147 | ||
9 | # | ||
10 | # Version 1.0 | ||
11 | # | ||
12 | |||
13 | |||
14 | # pull base image | ||
15 | FROM centos:centos6 | ||
16 | |||
17 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
18 | |||
19 | |||
20 | RUN echo "===> Installing EPEL..." && \ | ||
21 | yum -y install epel-release && \ | ||
22 | yum -y update && \ | ||
23 | \ | ||
24 | \ | ||
25 | echo "===> Installing initscripts to emulate normal OS behavior..." && \ | ||
26 | yum -y install initscripts && \ | ||
27 | \ | ||
28 | \ | ||
29 | echo "===> Adding Ansible's prerequisites..." && \ | ||
30 | yum -y install \ | ||
31 | gcc make \ | ||
32 | python python-devel python-pip \ | ||
33 | libffi-devel openssl-devel \ | ||
34 | libxml2 libxml2-devel libxslt libxslt-devel \ | ||
35 | git sudo curl && \ | ||
36 | pip install --upgrade pip && \ | ||
37 | pip install --upgrade \ | ||
38 | pyyaml jinja2 pycrypto paramiko httplib2 && \ | ||
39 | \ | ||
40 | \ | ||
41 | echo "===> Downloading Ansible's source tree..." && \ | ||
42 | git clone git://github.com/ansible/ansible.git --recursive && \ | ||
43 | \ | ||
44 | \ | ||
45 | echo "===> Compiling Ansible..." && \ | ||
46 | cd ansible && \ | ||
47 | bash -c 'source ./hacking/env-setup' && \ | ||
48 | \ | ||
49 | \ | ||
50 | echo "===> Moving useful Ansible stuff to /opt/ansible ..." && \ | ||
51 | mkdir -p /opt/ansible && \ | ||
52 | mv /ansible/bin /opt/ansible/bin && \ | ||
53 | mv /ansible/lib /opt/ansible/lib && \ | ||
54 | mv /ansible/docs /opt/ansible/docs && \ | ||
55 | rm -rf /ansible && \ | ||
56 | \ | ||
57 | \ | ||
58 | echo "===> Disabling sudo 'requiretty' setting..." && \ | ||
59 | sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers && \ | ||
60 | \ | ||
61 | \ | ||
62 | echo "===> Removing unused YUM resources..." && \ | ||
63 | yum -y remove epel-release gcc git python-devel python-pip \ | ||
64 | libffi-devel openssl-devel || true && \ | ||
65 | yum clean all && \ | ||
66 | \ | ||
67 | \ | ||
68 | echo "===> Adding hosts for convenience..." && \ | ||
69 | mkdir -p /etc/ansible && \ | ||
70 | echo 'localhost' > /etc/ansible/hosts | ||
71 | |||
72 | |||
73 | ENV PATH /opt/ansible/bin:$PATH | ||
74 | ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH | ||
75 | ENV MANPATH /opt/ansible/docs/man:$MANPATH | ||
76 | |||
77 | |||
78 | COPY ansible-playbook-wrapper /usr/local/bin/ | ||
79 | |||
80 | ONBUILD WORKDIR /tmp | ||
81 | ONBUILD COPY . /tmp | ||
82 | ONBUILD RUN \ | ||
83 | echo "===> Diagnosis: host information..." && \ | ||
84 | ansible -c local -m setup all | ||
85 | |||
86 | |||
87 | |||
88 | # default command: display Ansible version | ||
89 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/master-centos6-onbuild/ansible-playbook-wrapper b/master-centos6-onbuild/ansible-playbook-wrapper deleted file mode 100755 index dcc6723..0000000 --- a/master-centos6-onbuild/ansible-playbook-wrapper +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Simple wrapper for executing ansible-galaxy and ansible-playbook | ||
4 | # with local connection. | ||
5 | # | ||
6 | # USAGE: | ||
7 | # ansible-playbook-wrapper [other ansible-playbook arguments] | ||
8 | # | ||
9 | # ENVIRONMENT VARIABLES: | ||
10 | # | ||
11 | # - REQUIREMENTS: requirements filename; default = "requirements.yml" | ||
12 | # - PLAYBOOK: playbook filename; default = "playbook.yml" | ||
13 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" | ||
14 | # | ||
15 | |||
16 | |||
17 | # | ||
18 | # install Galaxy roles, if any | ||
19 | # | ||
20 | |||
21 | if [ -z "$REQUIREMENTS" ]; then | ||
22 | REQUIREMENTS=requirements.yml | ||
23 | fi | ||
24 | |||
25 | if [ -f "$REQUIREMENTS" ]; then | ||
26 | yum -y install git | ||
27 | ansible-galaxy install -r $REQUIREMENTS | ||
28 | fi | ||
29 | |||
30 | |||
31 | # | ||
32 | # execute playbook | ||
33 | # | ||
34 | |||
35 | if [ -z "$PLAYBOOK" ]; then | ||
36 | PLAYBOOK=playbook.yml | ||
37 | fi | ||
38 | |||
39 | |||
40 | if [ -z "$INVENTORY" ]; then | ||
41 | exec ansible-playbook \ | ||
42 | $PLAYBOOK \ | ||
43 | --connection=local \ | ||
44 | "$@" | ||
45 | else | ||
46 | exec ansible-playbook \ | ||
47 | -i $INVENTORY $PLAYBOOK \ | ||
48 | --connection=local \ | ||
49 | "$@" | ||
50 | fi | ||
diff --git a/master-centos6/Dockerfile b/master-centos6/Dockerfile deleted file mode 100644 index b647a4c..0000000 --- a/master-centos6/Dockerfile +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | # Dockerfile for building Ansible image from source for CentOS 6, with as few additional software as possible. | ||
2 | # | ||
3 | # @see http://docs.ansible.com/ansible/intro_installation.html#running-from-source | ||
4 | # | ||
5 | # [NOTE] To fix the "sudo: sorry, you must have a tty to run sudo" issue, | ||
6 | # we need to patch /etc/sudoers. | ||
7 | # @see http://unix.stackexchange.com/questions/122616/why-do-i-need-a-tty-to-run-sudo-if-i-can-sudo-without-a-password | ||
8 | # @see https://bugzilla.redhat.com/show_bug.cgi?id=1020147 | ||
9 | # | ||
10 | # Version 1.0 | ||
11 | # | ||
12 | |||
13 | |||
14 | # pull base image | ||
15 | FROM centos:centos6 | ||
16 | |||
17 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
18 | |||
19 | |||
20 | RUN echo "===> Installing EPEL..." && \ | ||
21 | yum -y install epel-release && \ | ||
22 | yum -y update && \ | ||
23 | \ | ||
24 | \ | ||
25 | echo "===> Installing initscripts to emulate normal OS behavior..." && \ | ||
26 | yum -y install initscripts && \ | ||
27 | \ | ||
28 | \ | ||
29 | echo "===> Adding Ansible's prerequisites..." && \ | ||
30 | yum -y install \ | ||
31 | gcc make \ | ||
32 | python python-devel python-pip \ | ||
33 | libffi-devel openssl-devel \ | ||
34 | libxml2 libxml2-devel libxslt libxslt-devel \ | ||
35 | git sudo curl && \ | ||
36 | pip install --upgrade pip && \ | ||
37 | pip install --upgrade \ | ||
38 | pyyaml jinja2 pycrypto paramiko httplib2 && \ | ||
39 | \ | ||
40 | \ | ||
41 | echo "===> Downloading Ansible's source tree..." && \ | ||
42 | git clone git://github.com/ansible/ansible.git --recursive && \ | ||
43 | \ | ||
44 | \ | ||
45 | echo "===> Compiling Ansible..." && \ | ||
46 | cd ansible && \ | ||
47 | bash -c 'source ./hacking/env-setup' && \ | ||
48 | \ | ||
49 | \ | ||
50 | echo "===> Moving useful Ansible stuff to /opt/ansible ..." && \ | ||
51 | mkdir -p /opt/ansible && \ | ||
52 | mv /ansible/bin /opt/ansible/bin && \ | ||
53 | mv /ansible/lib /opt/ansible/lib && \ | ||
54 | mv /ansible/docs /opt/ansible/docs && \ | ||
55 | rm -rf /ansible && \ | ||
56 | \ | ||
57 | \ | ||
58 | echo "===> Disabling sudo 'requiretty' setting..." && \ | ||
59 | sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers && \ | ||
60 | \ | ||
61 | \ | ||
62 | echo "===> Installing handy tools (not absolutely required)..." && \ | ||
63 | yum -y install sshpass openssh-clients && \ | ||
64 | \ | ||
65 | \ | ||
66 | echo "===> Removing unused YUM resources..." && \ | ||
67 | yum -y remove epel-release gcc git python-devel python-pip \ | ||
68 | libffi-devel openssl-devel || true && \ | ||
69 | yum clean all && \ | ||
70 | \ | ||
71 | \ | ||
72 | echo "===> Adding hosts for convenience..." && \ | ||
73 | mkdir -p /etc/ansible && \ | ||
74 | echo 'localhost' > /etc/ansible/hosts | ||
75 | |||
76 | |||
77 | ENV PATH /opt/ansible/bin:$PATH | ||
78 | ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH | ||
79 | ENV MANPATH /opt/ansible/docs/man:$MANPATH | ||
80 | |||
81 | |||
82 | # default command: display Ansible version | ||
83 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/master-centos7/Dockerfile b/master-centos7/Dockerfile index eb120a5..8f6a5b9 100644 --- a/master-centos7/Dockerfile +++ b/master-centos7/Dockerfile | |||
@@ -51,6 +51,7 @@ RUN echo "===> Enabling systemd..." && \ | |||
51 | pip install --upgrade pip && \ | 51 | pip install --upgrade pip && \ |
52 | pip install --upgrade \ | 52 | pip install --upgrade \ |
53 | pyyaml jinja2 pycrypto paramiko httplib2 && \ | 53 | pyyaml jinja2 pycrypto paramiko httplib2 && \ |
54 | pip install --upgrade pywinrm && \ | ||
54 | \ | 55 | \ |
55 | \ | 56 | \ |
56 | echo "===> Downloading Ansible's source tree..." && \ | 57 | echo "===> Downloading Ansible's source tree..." && \ |
diff --git a/master-debian7-onbuild/Dockerfile b/master-debian7-onbuild/Dockerfile deleted file mode 100644 index e787e2d..0000000 --- a/master-debian7-onbuild/Dockerfile +++ /dev/null | |||
@@ -1,77 +0,0 @@ | |||
1 | # Dockerfile for building Ansible image from source for Debian 7 (wheezy), with as few additional software as possible. | ||
2 | # | ||
3 | # @see http://docs.ansible.com/ansible/intro_installation.html#running-from-source | ||
4 | # | ||
5 | # Version 1.0 | ||
6 | # | ||
7 | |||
8 | |||
9 | # pull base image | ||
10 | FROM debian:wheezy | ||
11 | |||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
13 | |||
14 | |||
15 | RUN echo "===> Adding Ansible's prerequisites..." && \ | ||
16 | apt-get update -y && apt-get install --fix-missing && \ | ||
17 | DEBIAN_FRONTEND=noninteractive \ | ||
18 | apt-get install --no-install-recommends -y -q \ | ||
19 | build-essential ca-certificates \ | ||
20 | python-pip python-dev python-yaml \ | ||
21 | libffi-dev libssl-dev \ | ||
22 | libxml2-dev libxslt1-dev zlib1g-dev \ | ||
23 | git sudo curl && \ | ||
24 | pip install --upgrade cffi && \ | ||
25 | pip install --upgrade pyyaml jinja2 pycrypto && \ | ||
26 | \ | ||
27 | \ | ||
28 | echo "===> Downloading Ansible's source tree..." && \ | ||
29 | git clone git://github.com/ansible/ansible.git --recursive && \ | ||
30 | \ | ||
31 | \ | ||
32 | echo "===> Compiling Ansible..." && \ | ||
33 | cd ansible && \ | ||
34 | bash -c 'source ./hacking/env-setup' && \ | ||
35 | \ | ||
36 | \ | ||
37 | echo "===> Moving useful Ansible stuff to /opt/ansible ..." && \ | ||
38 | mkdir -p /opt/ansible && \ | ||
39 | mv /ansible/bin /opt/ansible/bin && \ | ||
40 | mv /ansible/lib /opt/ansible/lib && \ | ||
41 | mv /ansible/docs /opt/ansible/docs && \ | ||
42 | rm -rf /ansible && \ | ||
43 | \ | ||
44 | \ | ||
45 | echo "===> Clean up..." && \ | ||
46 | apt-get remove -y --auto-remove \ | ||
47 | build-essential python-pip python-dev git libffi-dev libssl-dev && \ | ||
48 | apt-get clean && \ | ||
49 | rm -rf /var/lib/apt/lists/* && \ | ||
50 | \ | ||
51 | \ | ||
52 | echo "===> Adding hosts for convenience..." && \ | ||
53 | mkdir -p /etc/ansible && \ | ||
54 | echo 'localhost' > /etc/ansible/hosts | ||
55 | |||
56 | |||
57 | ENV PATH /opt/ansible/bin:$PATH | ||
58 | ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH | ||
59 | ENV MANPATH /opt/ansible/docs/man:$MANPATH | ||
60 | |||
61 | |||
62 | COPY ansible-playbook-wrapper /usr/local/bin/ | ||
63 | |||
64 | ONBUILD RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ | ||
65 | echo "===> Updating TLS certificates..." && \ | ||
66 | apt-get install -y openssl ca-certificates | ||
67 | |||
68 | ONBUILD WORKDIR /tmp | ||
69 | ONBUILD COPY . /tmp | ||
70 | ONBUILD RUN \ | ||
71 | echo "===> Diagnosis: host information..." && \ | ||
72 | ansible -c local -m setup all | ||
73 | |||
74 | |||
75 | |||
76 | # default command: display Ansible version | ||
77 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/master-debian7-onbuild/ansible-playbook-wrapper b/master-debian7-onbuild/ansible-playbook-wrapper deleted file mode 100755 index afe4d97..0000000 --- a/master-debian7-onbuild/ansible-playbook-wrapper +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Simple wrapper for executing ansible-galaxy and ansible-playbook | ||
4 | # with local connection. | ||
5 | # | ||
6 | # USAGE: | ||
7 | # ansible-playbook-wrapper [other ansible-playbook arguments] | ||
8 | # | ||
9 | # ENVIRONMENT VARIABLES: | ||
10 | # | ||
11 | # - REQUIREMENTS: requirements filename; default = "requirements.yml" | ||
12 | # - PLAYBOOK: playbook filename; default = "playbook.yml" | ||
13 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" | ||
14 | # | ||
15 | |||
16 | |||
17 | # | ||
18 | # install Galaxy roles, if any | ||
19 | # | ||
20 | |||
21 | if [ -z "$REQUIREMENTS" ]; then | ||
22 | REQUIREMENTS=requirements.yml | ||
23 | fi | ||
24 | |||
25 | if [ -f "$REQUIREMENTS" ]; then | ||
26 | apt-get install -y git | ||
27 | ansible-galaxy install -r $REQUIREMENTS | ||
28 | fi | ||
29 | |||
30 | |||
31 | # | ||
32 | # execute playbook | ||
33 | # | ||
34 | |||
35 | if [ -z "$PLAYBOOK" ]; then | ||
36 | PLAYBOOK=playbook.yml | ||
37 | fi | ||
38 | |||
39 | |||
40 | if [ -z "$INVENTORY" ]; then | ||
41 | exec ansible-playbook \ | ||
42 | $PLAYBOOK \ | ||
43 | --connection=local \ | ||
44 | "$@" | ||
45 | else | ||
46 | exec ansible-playbook \ | ||
47 | -i $INVENTORY $PLAYBOOK \ | ||
48 | --connection=local \ | ||
49 | "$@" | ||
50 | fi | ||
diff --git a/master-debian7/Dockerfile b/master-debian7/Dockerfile deleted file mode 100644 index dd217c7..0000000 --- a/master-debian7/Dockerfile +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | # Dockerfile for building Ansible image from source for Debian 7 (wheezy), with as few additional software as possible. | ||
2 | # | ||
3 | # @see http://docs.ansible.com/ansible/intro_installation.html#running-from-source | ||
4 | # | ||
5 | # Version 1.0 | ||
6 | # | ||
7 | |||
8 | |||
9 | # pull base image | ||
10 | FROM debian:wheezy | ||
11 | |||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
13 | |||
14 | |||
15 | RUN echo "===> Adding Ansible's prerequisites..." && \ | ||
16 | apt-get update -y && apt-get install --fix-missing && \ | ||
17 | DEBIAN_FRONTEND=noninteractive \ | ||
18 | apt-get install --no-install-recommends -y -q \ | ||
19 | build-essential ca-certificates \ | ||
20 | python-pip python-dev python-yaml \ | ||
21 | libffi-dev libssl-dev \ | ||
22 | libxml2-dev libxslt1-dev zlib1g-dev \ | ||
23 | git sudo curl && \ | ||
24 | pip install --upgrade cffi && \ | ||
25 | pip install --upgrade pyyaml jinja2 pycrypto && \ | ||
26 | \ | ||
27 | \ | ||
28 | echo "===> Downloading Ansible's source tree..." && \ | ||
29 | git clone git://github.com/ansible/ansible.git --recursive && \ | ||
30 | \ | ||
31 | \ | ||
32 | echo "===> Compiling Ansible..." && \ | ||
33 | cd ansible && \ | ||
34 | bash -c 'source ./hacking/env-setup' && \ | ||
35 | \ | ||
36 | \ | ||
37 | echo "===> Moving useful Ansible stuff to /opt/ansible ..." && \ | ||
38 | mkdir -p /opt/ansible && \ | ||
39 | mv /ansible/bin /opt/ansible/bin && \ | ||
40 | mv /ansible/lib /opt/ansible/lib && \ | ||
41 | mv /ansible/docs /opt/ansible/docs && \ | ||
42 | rm -rf /ansible && \ | ||
43 | \ | ||
44 | \ | ||
45 | echo "===> Installing handy tools (not absolutely required)..." && \ | ||
46 | apt-get install -y sshpass openssh-client && \ | ||
47 | \ | ||
48 | \ | ||
49 | echo "===> Clean up..." && \ | ||
50 | apt-get remove -y --auto-remove \ | ||
51 | build-essential python-pip python-dev git libffi-dev libssl-dev && \ | ||
52 | apt-get clean && \ | ||
53 | rm -rf /var/lib/apt/lists/* && \ | ||
54 | \ | ||
55 | \ | ||
56 | echo "===> Adding hosts for convenience..." && \ | ||
57 | mkdir -p /etc/ansible && \ | ||
58 | echo 'localhost' > /etc/ansible/hosts | ||
59 | |||
60 | |||
61 | ENV PATH /opt/ansible/bin:$PATH | ||
62 | ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH | ||
63 | ENV MANPATH /opt/ansible/docs/man:$MANPATH | ||
64 | |||
65 | |||
66 | # default command: display Ansible version | ||
67 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/master-debian8-onbuild/Dockerfile b/master-debian8-onbuild/Dockerfile index c9ce493..79b8ec9 100644 --- a/master-debian8-onbuild/Dockerfile +++ b/master-debian8-onbuild/Dockerfile | |||
@@ -17,12 +17,17 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ | |||
17 | DEBIAN_FRONTEND=noninteractive \ | 17 | DEBIAN_FRONTEND=noninteractive \ |
18 | apt-get install --no-install-recommends -y -q \ | 18 | apt-get install --no-install-recommends -y -q \ |
19 | build-essential ca-certificates \ | 19 | build-essential ca-certificates \ |
20 | python-pip python-dev python-yaml \ | 20 | python python-pip python-dev \ |
21 | libffi-dev libssl-dev \ | 21 | libffi-dev libssl-dev \ |
22 | libxml2-dev libxslt1-dev zlib1g-dev \ | 22 | libxml2-dev libxslt1-dev zlib1g-dev \ |
23 | git sudo curl && \ | 23 | git sudo curl && \ |
24 | apt-get -y --purge remove python-cffi && \ | 24 | apt-get -y --purge remove python-cffi && \ |
25 | pip install --upgrade cffi && \ | 25 | \ |
26 | \ | ||
27 | echo "===> Fix strange bug under Jessie: cannot import name IncompleteRead" && \ | ||
28 | easy_install -U pip && \ | ||
29 | \ | ||
30 | pip install --upgrade cffi pywinrm && \ | ||
26 | pip install --upgrade pyyaml jinja2 pycrypto && \ | 31 | pip install --upgrade pyyaml jinja2 pycrypto && \ |
27 | \ | 32 | \ |
28 | \ | 33 | \ |
diff --git a/master-debian8/Dockerfile b/master-debian8/Dockerfile index f5ea797..d600520 100644 --- a/master-debian8/Dockerfile +++ b/master-debian8/Dockerfile | |||
@@ -17,12 +17,17 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ | |||
17 | DEBIAN_FRONTEND=noninteractive \ | 17 | DEBIAN_FRONTEND=noninteractive \ |
18 | apt-get install --no-install-recommends -y -q \ | 18 | apt-get install --no-install-recommends -y -q \ |
19 | build-essential ca-certificates \ | 19 | build-essential ca-certificates \ |
20 | python-pip python-dev python-yaml \ | 20 | python python-pip python-dev \ |
21 | libffi-dev libssl-dev \ | 21 | libffi-dev libssl-dev \ |
22 | libxml2-dev libxslt1-dev zlib1g-dev \ | 22 | libxml2-dev libxslt1-dev zlib1g-dev \ |
23 | git sudo curl && \ | 23 | git sudo curl && \ |
24 | apt-get -y --purge remove python-cffi && \ | 24 | apt-get -y --purge remove python-cffi && \ |
25 | pip install --upgrade cffi && \ | 25 | \ |
26 | \ | ||
27 | echo "===> Fix strange bug under Jessie: cannot import name IncompleteRead" && \ | ||
28 | easy_install -U pip && \ | ||
29 | \ | ||
30 | pip install --upgrade cffi pywinrm && \ | ||
26 | pip install --upgrade pyyaml jinja2 pycrypto && \ | 31 | pip install --upgrade pyyaml jinja2 pycrypto && \ |
27 | \ | 32 | \ |
28 | \ | 33 | \ |
@@ -44,6 +49,7 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ | |||
44 | \ | 49 | \ |
45 | \ | 50 | \ |
46 | echo "===> Installing handy tools (not absolutely required)..." && \ | 51 | echo "===> Installing handy tools (not absolutely required)..." && \ |
52 | |||
47 | apt-get install -y sshpass openssh-client && \ | 53 | apt-get install -y sshpass openssh-client && \ |
48 | \ | 54 | \ |
49 | \ | 55 | \ |
diff --git a/master-ubuntu12.04-onbuild/Dockerfile b/master-ubuntu12.04-onbuild/Dockerfile deleted file mode 100644 index ed11e78..0000000 --- a/master-ubuntu12.04-onbuild/Dockerfile +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | # Dockerfile for building Ansible image from source for Ubuntu 12.04 (presice), with as few additional software as possible. | ||
2 | # | ||
3 | # @see http://docs.ansible.com/ansible/intro_installation.html#running-from-source | ||
4 | # | ||
5 | # Version 1.0 | ||
6 | # | ||
7 | |||
8 | |||
9 | # pull base image | ||
10 | FROM ubuntu:12.04 | ||
11 | |||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
13 | |||
14 | |||
15 | RUN echo "===> Adding Ansible's prerequisites..." && \ | ||
16 | apt-get update -y && \ | ||
17 | DEBIAN_FRONTEND=noninteractive \ | ||
18 | apt-get install --no-install-recommends -y -q \ | ||
19 | build-essential \ | ||
20 | python-pip python-dev python-yaml \ | ||
21 | libxml2-dev libxslt1-dev zlib1g-dev \ | ||
22 | git sudo && \ | ||
23 | pip install --upgrade pyyaml jinja2 pycrypto && \ | ||
24 | \ | ||
25 | \ | ||
26 | echo "===> Downloading Ansible's source tree..." && \ | ||
27 | git clone git://github.com/ansible/ansible.git --recursive && \ | ||
28 | \ | ||
29 | \ | ||
30 | echo "===> Compiling Ansible..." && \ | ||
31 | cd ansible && \ | ||
32 | bash -c 'source ./hacking/env-setup' && \ | ||
33 | \ | ||
34 | \ | ||
35 | echo "===> Moving useful Ansible stuff to /opt/ansible ..." && \ | ||
36 | mkdir -p /opt/ansible && \ | ||
37 | mv /ansible/bin /opt/ansible/bin && \ | ||
38 | mv /ansible/lib /opt/ansible/lib && \ | ||
39 | mv /ansible/docs /opt/ansible/docs && \ | ||
40 | rm -rf /ansible && \ | ||
41 | \ | ||
42 | \ | ||
43 | echo "===> Clean up..." && \ | ||
44 | apt-get remove -y --auto-remove \ | ||
45 | build-essential python-pip python-dev git && \ | ||
46 | apt-get clean && \ | ||
47 | rm -rf /var/lib/apt/lists/* && \ | ||
48 | \ | ||
49 | \ | ||
50 | echo "===> Adding hosts for convenience..." && \ | ||
51 | mkdir -p /etc/ansible && \ | ||
52 | echo 'localhost' > /etc/ansible/hosts | ||
53 | |||
54 | |||
55 | ENV PATH /opt/ansible/bin:$PATH | ||
56 | ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH | ||
57 | ENV MANPATH /opt/ansible/docs/man:$MANPATH | ||
58 | |||
59 | |||
60 | # default command: display Ansible version | ||
61 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/master-ubuntu12.04-onbuild/ansible-playbook-wrapper b/master-ubuntu12.04-onbuild/ansible-playbook-wrapper deleted file mode 100755 index afe4d97..0000000 --- a/master-ubuntu12.04-onbuild/ansible-playbook-wrapper +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Simple wrapper for executing ansible-galaxy and ansible-playbook | ||
4 | # with local connection. | ||
5 | # | ||
6 | # USAGE: | ||
7 | # ansible-playbook-wrapper [other ansible-playbook arguments] | ||
8 | # | ||
9 | # ENVIRONMENT VARIABLES: | ||
10 | # | ||
11 | # - REQUIREMENTS: requirements filename; default = "requirements.yml" | ||
12 | # - PLAYBOOK: playbook filename; default = "playbook.yml" | ||
13 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" | ||
14 | # | ||
15 | |||
16 | |||
17 | # | ||
18 | # install Galaxy roles, if any | ||
19 | # | ||
20 | |||
21 | if [ -z "$REQUIREMENTS" ]; then | ||
22 | REQUIREMENTS=requirements.yml | ||
23 | fi | ||
24 | |||
25 | if [ -f "$REQUIREMENTS" ]; then | ||
26 | apt-get install -y git | ||
27 | ansible-galaxy install -r $REQUIREMENTS | ||
28 | fi | ||
29 | |||
30 | |||
31 | # | ||
32 | # execute playbook | ||
33 | # | ||
34 | |||
35 | if [ -z "$PLAYBOOK" ]; then | ||
36 | PLAYBOOK=playbook.yml | ||
37 | fi | ||
38 | |||
39 | |||
40 | if [ -z "$INVENTORY" ]; then | ||
41 | exec ansible-playbook \ | ||
42 | $PLAYBOOK \ | ||
43 | --connection=local \ | ||
44 | "$@" | ||
45 | else | ||
46 | exec ansible-playbook \ | ||
47 | -i $INVENTORY $PLAYBOOK \ | ||
48 | --connection=local \ | ||
49 | "$@" | ||
50 | fi | ||
diff --git a/master-ubuntu12.04/Dockerfile b/master-ubuntu12.04/Dockerfile deleted file mode 100644 index 021eeb9..0000000 --- a/master-ubuntu12.04/Dockerfile +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | # Dockerfile for building Ansible image from source for Ubuntu 12.04 (presice), with as few additional software as possible. | ||
2 | # | ||
3 | # @see http://docs.ansible.com/ansible/intro_installation.html#running-from-source | ||
4 | # | ||
5 | # Version 1.0 | ||
6 | # | ||
7 | |||
8 | |||
9 | # pull base image | ||
10 | FROM ubuntu:12.04 | ||
11 | |||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
13 | |||
14 | |||
15 | RUN echo "===> Adding Ansible's prerequisites..." && \ | ||
16 | apt-get update -y && \ | ||
17 | DEBIAN_FRONTEND=noninteractive \ | ||
18 | apt-get install --no-install-recommends -y -q \ | ||
19 | build-essential \ | ||
20 | python-pip python-dev python-yaml \ | ||
21 | libxml2-dev libxslt1-dev zlib1g-dev \ | ||
22 | git sudo && \ | ||
23 | pip install --upgrade pyyaml jinja2 pycrypto && \ | ||
24 | \ | ||
25 | \ | ||
26 | echo "===> Downloading Ansible's source tree..." && \ | ||
27 | git clone git://github.com/ansible/ansible.git --recursive && \ | ||
28 | \ | ||
29 | \ | ||
30 | echo "===> Compiling Ansible..." && \ | ||
31 | cd ansible && \ | ||
32 | bash -c 'source ./hacking/env-setup' && \ | ||
33 | \ | ||
34 | \ | ||
35 | echo "===> Moving useful Ansible stuff to /opt/ansible ..." && \ | ||
36 | mkdir -p /opt/ansible && \ | ||
37 | mv /ansible/bin /opt/ansible/bin && \ | ||
38 | mv /ansible/lib /opt/ansible/lib && \ | ||
39 | mv /ansible/docs /opt/ansible/docs && \ | ||
40 | rm -rf /ansible && \ | ||
41 | \ | ||
42 | \ | ||
43 | echo "===> Installing handy tools (not absolutely required)..." && \ | ||
44 | apt-get install -y sshpass openssh-client && \ | ||
45 | \ | ||
46 | \ | ||
47 | echo "===> Clean up..." && \ | ||
48 | apt-get remove -y --auto-remove \ | ||
49 | build-essential python-pip python-dev git && \ | ||
50 | apt-get clean && \ | ||
51 | rm -rf /var/lib/apt/lists/* && \ | ||
52 | \ | ||
53 | \ | ||
54 | echo "===> Adding hosts for convenience..." && \ | ||
55 | mkdir -p /etc/ansible && \ | ||
56 | echo 'localhost' > /etc/ansible/hosts | ||
57 | |||
58 | |||
59 | ENV PATH /opt/ansible/bin:$PATH | ||
60 | ENV PYTHONPATH /opt/ansible/lib:$PYTHONPATH | ||
61 | ENV MANPATH /opt/ansible/docs/man:$MANPATH | ||
62 | |||
63 | |||
64 | # default command: display Ansible version | ||
65 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/master-ubuntu14.04-onbuild/Dockerfile b/master-ubuntu14.04-onbuild/Dockerfile index 937d783..620d2f0 100644 --- a/master-ubuntu14.04-onbuild/Dockerfile +++ b/master-ubuntu14.04-onbuild/Dockerfile | |||
@@ -17,10 +17,12 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ | |||
17 | DEBIAN_FRONTEND=noninteractive \ | 17 | DEBIAN_FRONTEND=noninteractive \ |
18 | apt-get install --no-install-recommends -y -q \ | 18 | apt-get install --no-install-recommends -y -q \ |
19 | build-essential \ | 19 | build-essential \ |
20 | python-pip python-dev python-yaml \ | 20 | python python-pip python-dev \ |
21 | libxml2-dev libxslt1-dev zlib1g-dev \ | 21 | libxml2-dev libxslt1-dev zlib1g-dev \ |
22 | git && \ | 22 | git && \ |
23 | pip install --upgrade setuptools pip wheel && \ | ||
23 | pip install --upgrade pyyaml jinja2 pycrypto && \ | 24 | pip install --upgrade pyyaml jinja2 pycrypto && \ |
25 | pip install --upgrade pywinrm && \ | ||
24 | \ | 26 | \ |
25 | \ | 27 | \ |
26 | echo "===> Downloading Ansible's source tree..." && \ | 28 | echo "===> Downloading Ansible's source tree..." && \ |
diff --git a/master-ubuntu14.04/Dockerfile b/master-ubuntu14.04/Dockerfile index a727507..bd166e4 100644 --- a/master-ubuntu14.04/Dockerfile +++ b/master-ubuntu14.04/Dockerfile | |||
@@ -17,10 +17,12 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ | |||
17 | DEBIAN_FRONTEND=noninteractive \ | 17 | DEBIAN_FRONTEND=noninteractive \ |
18 | apt-get install --no-install-recommends -y -q \ | 18 | apt-get install --no-install-recommends -y -q \ |
19 | build-essential \ | 19 | build-essential \ |
20 | python-pip python-dev python-yaml \ | 20 | python python-pip python-dev \ |
21 | libxml2-dev libxslt1-dev zlib1g-dev \ | 21 | libxml2-dev libxslt1-dev zlib1g-dev \ |
22 | git && \ | 22 | git && \ |
23 | pip install --upgrade setuptools pip wheel && \ | ||
23 | pip install --upgrade pyyaml jinja2 pycrypto && \ | 24 | pip install --upgrade pyyaml jinja2 pycrypto && \ |
25 | pip install --upgrade pywinrm && \ | ||
24 | \ | 26 | \ |
25 | \ | 27 | \ |
26 | echo "===> Downloading Ansible's source tree..." && \ | 28 | echo "===> Downloading Ansible's source tree..." && \ |
diff --git a/master-ubuntu16.04-onbuild/Dockerfile b/master-ubuntu16.04-onbuild/Dockerfile index bbd0029..7019ae2 100644 --- a/master-ubuntu16.04-onbuild/Dockerfile +++ b/master-ubuntu16.04-onbuild/Dockerfile | |||
@@ -17,12 +17,13 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ | |||
17 | DEBIAN_FRONTEND=noninteractive \ | 17 | DEBIAN_FRONTEND=noninteractive \ |
18 | apt-get install --no-install-recommends -y -q \ | 18 | apt-get install --no-install-recommends -y -q \ |
19 | build-essential \ | 19 | build-essential \ |
20 | python-pip python-dev python-yaml \ | 20 | python python-pip python-dev \ |
21 | libffi-dev libssl-dev \ | 21 | libffi-dev libssl-dev \ |
22 | libxml2-dev libxslt1-dev zlib1g-dev \ | 22 | libxml2-dev libxslt1-dev zlib1g-dev \ |
23 | git && \ | 23 | git && \ |
24 | pip install --upgrade wheel setuptools && \ | 24 | pip install --upgrade setuptools pip wheel && \ |
25 | pip install --upgrade pyyaml jinja2 pycrypto && \ | 25 | pip install --upgrade pyyaml jinja2 pycrypto && \ |
26 | pip install --upgrade pywinrm && \ | ||
26 | \ | 27 | \ |
27 | \ | 28 | \ |
28 | echo "===> Downloading Ansible's source tree..." && \ | 29 | echo "===> Downloading Ansible's source tree..." && \ |
diff --git a/master-ubuntu16.04/Dockerfile b/master-ubuntu16.04/Dockerfile index 6b601a6..4dcc074 100644 --- a/master-ubuntu16.04/Dockerfile +++ b/master-ubuntu16.04/Dockerfile | |||
@@ -17,12 +17,13 @@ RUN echo "===> Adding Ansible's prerequisites..." && \ | |||
17 | DEBIAN_FRONTEND=noninteractive \ | 17 | DEBIAN_FRONTEND=noninteractive \ |
18 | apt-get install --no-install-recommends -y -q \ | 18 | apt-get install --no-install-recommends -y -q \ |
19 | build-essential \ | 19 | build-essential \ |
20 | python-pip python-dev python-yaml \ | 20 | python python-pip python-dev \ |
21 | libffi-dev libssl-dev \ | 21 | libffi-dev libssl-dev \ |
22 | libxml2-dev libxslt1-dev zlib1g-dev \ | 22 | libxml2-dev libxslt1-dev zlib1g-dev \ |
23 | git && \ | 23 | git && \ |
24 | pip install --upgrade wheel setuptools && \ | 24 | pip install --upgrade setuptools pip wheel && \ |
25 | pip install --upgrade pyyaml jinja2 pycrypto && \ | 25 | pip install --upgrade pyyaml jinja2 pycrypto && \ |
26 | pip install --upgrade pywinrm && \ | ||
26 | \ | 27 | \ |
27 | \ | 28 | \ |
28 | echo "===> Downloading Ansible's source tree..." && \ | 29 | echo "===> Downloading Ansible's source tree..." && \ |
diff --git a/mini-alpine3/Dockerfile b/mini-alpine3/Dockerfile index 76f0a19..b60308b 100644 --- a/mini-alpine3/Dockerfile +++ b/mini-alpine3/Dockerfile | |||
@@ -7,7 +7,7 @@ | |||
7 | 7 | ||
8 | 8 | ||
9 | # pull base image | 9 | # pull base image |
10 | FROM alpine:3.4 | 10 | FROM alpine:3.6 |
11 | 11 | ||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | 12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> |
13 | 13 | ||
diff --git a/ubuntu12.04-onbuild/Dockerfile b/ubuntu12.04-onbuild/Dockerfile deleted file mode 100644 index 3816c24..0000000 --- a/ubuntu12.04-onbuild/Dockerfile +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | # Dockerfile for building Ansible image for Ubuntu 12.04 (presice), with as few additional software as possible. | ||
2 | # | ||
3 | # @see https://launchpad.net/~ansible/+archive/ubuntu/ansible | ||
4 | # | ||
5 | # Version 1.0 | ||
6 | # | ||
7 | |||
8 | |||
9 | # pull base image | ||
10 | FROM ubuntu:12.04 | ||
11 | |||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
13 | |||
14 | |||
15 | RUN echo "===> Adding Ansible's PPA..." && \ | ||
16 | echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu precise main" | tee /etc/apt/sources.list.d/ansible.list && \ | ||
17 | echo "deb-src http://ppa.launchpad.net/ansible/ansible/ubuntu precise main" | tee -a /etc/apt/sources.list.d/ansible.list && \ | ||
18 | apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7BB9C367 && \ | ||
19 | DEBIAN_FRONTEND=noninteractive apt-get update && \ | ||
20 | \ | ||
21 | \ | ||
22 | echo "===> Installing Ansible (and sudo)..." && \ | ||
23 | apt-get install -y ansible sudo && \ | ||
24 | \ | ||
25 | \ | ||
26 | echo "===> Removing Ansible PPA..." && \ | ||
27 | rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/ansible.list && \ | ||
28 | \ | ||
29 | \ | ||
30 | echo "===> Adding hosts for convenience..." && \ | ||
31 | echo 'localhost' > /etc/ansible/hosts | ||
32 | |||
33 | |||
34 | COPY ansible-playbook-wrapper /usr/local/bin/ | ||
35 | |||
36 | ONBUILD RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ | ||
37 | echo "===> Updating TLS certificates..." && \ | ||
38 | apt-get install -y openssl ca-certificates | ||
39 | |||
40 | ONBUILD WORKDIR /tmp | ||
41 | ONBUILD COPY . /tmp | ||
42 | ONBUILD RUN \ | ||
43 | echo "===> Diagnosis: host information..." && \ | ||
44 | ansible -c local -m setup all | ||
45 | |||
46 | |||
47 | |||
48 | # default command: display Ansible version | ||
49 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/ubuntu12.04-onbuild/ansible-playbook-wrapper b/ubuntu12.04-onbuild/ansible-playbook-wrapper deleted file mode 100755 index afe4d97..0000000 --- a/ubuntu12.04-onbuild/ansible-playbook-wrapper +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Simple wrapper for executing ansible-galaxy and ansible-playbook | ||
4 | # with local connection. | ||
5 | # | ||
6 | # USAGE: | ||
7 | # ansible-playbook-wrapper [other ansible-playbook arguments] | ||
8 | # | ||
9 | # ENVIRONMENT VARIABLES: | ||
10 | # | ||
11 | # - REQUIREMENTS: requirements filename; default = "requirements.yml" | ||
12 | # - PLAYBOOK: playbook filename; default = "playbook.yml" | ||
13 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" | ||
14 | # | ||
15 | |||
16 | |||
17 | # | ||
18 | # install Galaxy roles, if any | ||
19 | # | ||
20 | |||
21 | if [ -z "$REQUIREMENTS" ]; then | ||
22 | REQUIREMENTS=requirements.yml | ||
23 | fi | ||
24 | |||
25 | if [ -f "$REQUIREMENTS" ]; then | ||
26 | apt-get install -y git | ||
27 | ansible-galaxy install -r $REQUIREMENTS | ||
28 | fi | ||
29 | |||
30 | |||
31 | # | ||
32 | # execute playbook | ||
33 | # | ||
34 | |||
35 | if [ -z "$PLAYBOOK" ]; then | ||
36 | PLAYBOOK=playbook.yml | ||
37 | fi | ||
38 | |||
39 | |||
40 | if [ -z "$INVENTORY" ]; then | ||
41 | exec ansible-playbook \ | ||
42 | $PLAYBOOK \ | ||
43 | --connection=local \ | ||
44 | "$@" | ||
45 | else | ||
46 | exec ansible-playbook \ | ||
47 | -i $INVENTORY $PLAYBOOK \ | ||
48 | --connection=local \ | ||
49 | "$@" | ||
50 | fi | ||
diff --git a/ubuntu12.04/Dockerfile b/ubuntu12.04/Dockerfile deleted file mode 100644 index 1dd4c58..0000000 --- a/ubuntu12.04/Dockerfile +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | # Dockerfile for building Ansible image for Ubuntu 12.04 (presice), with as few additional software as possible. | ||
2 | # | ||
3 | # @see https://launchpad.net/~ansible/+archive/ubuntu/ansible | ||
4 | # | ||
5 | # Version 1.0 | ||
6 | # | ||
7 | |||
8 | |||
9 | # pull base image | ||
10 | FROM ubuntu:12.04 | ||
11 | |||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
13 | |||
14 | |||
15 | RUN echo "===> Adding Ansible's PPA..." && \ | ||
16 | echo "deb http://ppa.launchpad.net/ansible/ansible/ubuntu precise main" | tee /etc/apt/sources.list.d/ansible.list && \ | ||
17 | echo "deb-src http://ppa.launchpad.net/ansible/ansible/ubuntu precise main" | tee -a /etc/apt/sources.list.d/ansible.list && \ | ||
18 | apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7BB9C367 && \ | ||
19 | DEBIAN_FRONTEND=noninteractive apt-get update && \ | ||
20 | \ | ||
21 | \ | ||
22 | echo "===> Installing Ansible (and sudo)..." && \ | ||
23 | apt-get install -y ansible sudo && \ | ||
24 | \ | ||
25 | \ | ||
26 | echo "===> Installing handy tools (not absolutely required)..." && \ | ||
27 | apt-get install -y sshpass openssh-client && \ | ||
28 | \ | ||
29 | \ | ||
30 | echo "===> Removing Ansible PPA..." && \ | ||
31 | rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/ansible.list && \ | ||
32 | \ | ||
33 | \ | ||
34 | echo "===> Adding hosts for convenience..." && \ | ||
35 | echo 'localhost' > /etc/ansible/hosts | ||
36 | |||
37 | |||
38 | # default command: display Ansible version | ||
39 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/ubuntu14.04/Dockerfile b/ubuntu14.04/Dockerfile index ef29eb9..e762a35 100644 --- a/ubuntu14.04/Dockerfile +++ b/ubuntu14.04/Dockerfile | |||
@@ -24,6 +24,8 @@ RUN echo "===> Adding Ansible's PPA..." && \ | |||
24 | \ | 24 | \ |
25 | \ | 25 | \ |
26 | echo "===> Installing handy tools (not absolutely required)..." && \ | 26 | echo "===> Installing handy tools (not absolutely required)..." && \ |
27 | apt-get install -y python-pip && \ | ||
28 | pip install --upgrade pywinrm && \ | ||
27 | apt-get install -y sshpass openssh-client && \ | 29 | apt-get install -y sshpass openssh-client && \ |
28 | \ | 30 | \ |
29 | \ | 31 | \ |
diff --git a/ubuntu16.04/Dockerfile b/ubuntu16.04/Dockerfile index 201552e..0772f0c 100644 --- a/ubuntu16.04/Dockerfile +++ b/ubuntu16.04/Dockerfile | |||
@@ -24,6 +24,8 @@ RUN echo "===> Adding Ansible's PPA..." && \ | |||
24 | \ | 24 | \ |
25 | \ | 25 | \ |
26 | echo "===> Installing handy tools (not absolutely required)..." && \ | 26 | echo "===> Installing handy tools (not absolutely required)..." && \ |
27 | apt-get install -y python-pip && \ | ||
28 | pip install --upgrade pywinrm && \ | ||
27 | apt-get install -y sshpass openssh-client && \ | 29 | apt-get install -y sshpass openssh-client && \ |
28 | \ | 30 | \ |
29 | \ | 31 | \ |