diff options
24 files changed, 1141 insertions, 7 deletions
diff --git a/.travis.yml b/.travis.yml index 3ec8589..9725e04 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -22,18 +22,36 @@ before_install: | |||
22 | - docker build -t ansible_centos6_onbuild centos6-onbuild | 22 | - docker build -t ansible_centos6_onbuild centos6-onbuild |
23 | - docker build -t ansible_alpine3_onbuild alpine3-onbuild | 23 | - docker build -t ansible_alpine3_onbuild alpine3-onbuild |
24 | 24 | ||
25 | |||
26 | - docker build -t ansible_1.9_trusty 1.9-ubuntu14.04 | ||
27 | - docker build -t ansible_1.9_precise 1.9-ubuntu12.04 | ||
28 | - docker build -t ansible_1.9_jessie 1.9-debian8 | ||
29 | - docker build -t ansible_1.9_wheezy 1.9-debian7 | ||
30 | - docker build -t ansible_1.9_centos7 1.9-centos7 | ||
31 | - docker build -t ansible_1.9_centos6 1.9-centos6 | ||
32 | - docker build -t ansible_1.9_alpine3 1.9-alpine3 | ||
33 | |||
34 | - docker build -t ansible_1.9_trusty_onbuild 1.9-ubuntu14.04-onbuild | ||
35 | - docker build -t ansible_1.9_precise_onbuild 1.9-ubuntu12.04-onbuild | ||
36 | - docker build -t ansible_1.9_jessie_onbuild 1.9-debian8-onbuild | ||
37 | - docker build -t ansible_1.9_wheezy_onbuild 1.9-debian7-onbuild | ||
38 | - docker build -t ansible_1.9_centos7_onbuild 1.9-centos7-onbuild | ||
39 | - docker build -t ansible_1.9_centos6_onbuild 1.9-centos6-onbuild | ||
40 | - docker build -t ansible_1.9_alpine3_onbuild 1.9-alpine3-onbuild | ||
41 | |||
42 | |||
25 | - docker build -t ansible_master_trusty master-ubuntu14.04 | 43 | - docker build -t ansible_master_trusty master-ubuntu14.04 |
26 | - docker build -t ansible_master_precise master-ubuntu12.04 | 44 | - docker build -t ansible_master_precise master-ubuntu12.04 |
27 | - docker build -t ansible_master_jessie master-debian8 | 45 | - docker build -t ansible_master_jessie master-debian8 |
28 | - docker build -t ansible_master_wheezy master-debian7 | 46 | - docker build -t ansible_master_wheezy master-debian7 |
29 | - docker build -t ansible_master_centos7 master-centos7 | 47 | #- docker build -t ansible_master_centos7 master-centos7 |
30 | - docker build -t ansible_master_centos6 master-centos6 | 48 | - docker build -t ansible_master_centos6 master-centos6 |
31 | 49 | ||
32 | - docker build -t ansible_master_trusty_onbuild master-ubuntu14.04-onbuild | 50 | - docker build -t ansible_master_trusty_onbuild master-ubuntu14.04-onbuild |
33 | - docker build -t ansible_master_precise_onbuild master-ubuntu12.04-onbuild | 51 | - docker build -t ansible_master_precise_onbuild master-ubuntu12.04-onbuild |
34 | - docker build -t ansible_master_jessie_onbuild master-debian8-onbuild | 52 | - docker build -t ansible_master_jessie_onbuild master-debian8-onbuild |
35 | - docker build -t ansible_master_wheezy_onbuild master-debian7-onbuild | 53 | - docker build -t ansible_master_wheezy_onbuild master-debian7-onbuild |
36 | - docker build -t ansible_master_centos7_onbuild master-centos7-onbuild | 54 | #- docker build -t ansible_master_centos7_onbuild master-centos7-onbuild |
37 | - docker build -t ansible_master_centos6_onbuild master-centos6-onbuild | 55 | - docker build -t ansible_master_centos6_onbuild master-centos6-onbuild |
38 | 56 | ||
39 | script: | 57 | script: |
@@ -52,20 +70,38 @@ script: | |||
52 | - docker run -i ansible_centos6_onbuild > result-centos6-onbuild | 70 | - docker run -i ansible_centos6_onbuild > result-centos6-onbuild |
53 | - docker run -i ansible_alpine3_onbuild > result-alpine3-onbuild | 71 | - docker run -i ansible_alpine3_onbuild > result-alpine3-onbuild |
54 | 72 | ||
73 | |||
74 | - docker run -i ansible_1.9_trusty > result-1.9-ubuntu14.04 | ||
75 | - docker run -i ansible_1.9_precise > result-1.9-ubuntu12.04 | ||
76 | - docker run -i ansible_1.9_jessie > result-1.9-debian8 | ||
77 | - docker run -i ansible_1.9_wheezy > result-1.9-debian7 | ||
78 | - docker run -i ansible_1.9_centos7 > result-1.9-centos7 | ||
79 | - docker run -i ansible_1.9_centos6 > result-1.9-centos6 | ||
80 | - docker run -i ansible_1.9_alpine3 > result-1.9-alpine3 | ||
81 | - docker run -i ansible_1.9_trusty_onbuild > result-1.9-ubuntu14.04-onbuild | ||
82 | - docker run -i ansible_1.9_precise_onbuild > result-1.9-ubuntu12.04-onbuild | ||
83 | - docker run -i ansible_1.9_jessie_onbuild > result-1.9-debian8-onbuild | ||
84 | - docker run -i ansible_1.9_wheezy_onbuild > result-1.9-debian7-onbuild | ||
85 | - docker run -i ansible_1.9_centos7_onbuild > result-1.9-centos7-onbuild | ||
86 | - docker run -i ansible_1.9_centos6_onbuild > result-1.9-centos6-onbuild | ||
87 | - docker run -i ansible_1.9_alpine3_onbuild > result-1.9-alpine3-onbuild | ||
88 | |||
89 | |||
55 | - docker run -i ansible_master_trusty > result-master-ubuntu14.04 | 90 | - docker run -i ansible_master_trusty > result-master-ubuntu14.04 |
56 | - docker run -i ansible_master_precise > result-master-ubuntu12.04 | 91 | - docker run -i ansible_master_precise > result-master-ubuntu12.04 |
57 | - docker run -i ansible_master_jessie > result-master-debian8 | 92 | - docker run -i ansible_master_jessie > result-master-debian8 |
58 | - docker run -i ansible_master_wheezy > result-master-debian7 | 93 | - docker run -i ansible_master_wheezy > result-master-debian7 |
59 | - docker run -i ansible_master_centos7 > result-master-centos7 | 94 | #- docker run -i ansible_master_centos7 > result-master-centos7 |
60 | - docker run -i ansible_master_centos6 > result-master-centos6 | 95 | - docker run -i ansible_master_centos6 > result-master-centos6 |
61 | - docker run -i ansible_master_trusty_onbuild > result-master-ubuntu14.04-onbuild | 96 | - docker run -i ansible_master_trusty_onbuild > result-master-ubuntu14.04-onbuild |
62 | - docker run -i ansible_master_precise_onbuild > result-master-ubuntu12.04-onbuild | 97 | - docker run -i ansible_master_precise_onbuild > result-master-ubuntu12.04-onbuild |
63 | - docker run -i ansible_master_jessie_onbuild > result-master-debian8-onbuild | 98 | - docker run -i ansible_master_jessie_onbuild > result-master-debian8-onbuild |
64 | - docker run -i ansible_master_wheezy_onbuild > result-master-debian7-onbuild | 99 | - docker run -i ansible_master_wheezy_onbuild > result-master-debian7-onbuild |
65 | - docker run -i ansible_master_centos7_onbuild > result-master-centos7-onbuild | 100 | #- docker run -i ansible_master_centos7_onbuild > result-master-centos7-onbuild |
66 | - docker run -i ansible_master_centos6_onbuild > result-master-centos6-onbuild | 101 | - docker run -i ansible_master_centos6_onbuild > result-master-centos6-onbuild |
67 | 102 | ||
68 | 103 | ||
104 | |||
69 | - echo "==> Validating the test results..." | 105 | - echo "==> Validating the test results..." |
70 | - sh -c "[ -s result-ubuntu14.04 ]" | 106 | - sh -c "[ -s result-ubuntu14.04 ]" |
71 | - sh -c "[ -s result-ubuntu12.04 ]" | 107 | - sh -c "[ -s result-ubuntu12.04 ]" |
@@ -82,15 +118,30 @@ script: | |||
82 | - sh -c "[ -s result-centos6-onbuild ]" | 118 | - sh -c "[ -s result-centos6-onbuild ]" |
83 | - sh -c "[ -s result-alpine3-onbuild ]" | 119 | - sh -c "[ -s result-alpine3-onbuild ]" |
84 | 120 | ||
121 | - sh -c "[ -s result-1.9-ubuntu14.04 ]" | ||
122 | - sh -c "[ -s result-1.9-ubuntu12.04 ]" | ||
123 | - sh -c "[ -s result-1.9-debian8 ]" | ||
124 | - sh -c "[ -s result-1.9-debian7 ]" | ||
125 | - sh -c "[ -s result-1.9-centos7 ]" | ||
126 | - sh -c "[ -s result-1.9-centos6 ]" | ||
127 | - sh -c "[ -s result-1.9-alpine3 ]" | ||
128 | - sh -c "[ -s result-1.9-ubuntu14.04-onbuild ]" | ||
129 | - sh -c "[ -s result-1.9-ubuntu12.04-onbuild ]" | ||
130 | - sh -c "[ -s result-1.9-debian8-onbuild ]" | ||
131 | - sh -c "[ -s result-1.9-debian7-onbuild ]" | ||
132 | - sh -c "[ -s result-1.9-centos7-onbuild ]" | ||
133 | - sh -c "[ -s result-1.9-centos6-onbuild ]" | ||
134 | - sh -c "[ -s result-1.9-alpine3-onbuild ]" | ||
135 | |||
85 | - sh -c "[ -s result-master-ubuntu14.04 ]" | 136 | - sh -c "[ -s result-master-ubuntu14.04 ]" |
86 | - sh -c "[ -s result-master-ubuntu12.04 ]" | 137 | - sh -c "[ -s result-master-ubuntu12.04 ]" |
87 | - sh -c "[ -s result-master-debian8 ]" | 138 | - sh -c "[ -s result-master-debian8 ]" |
88 | - sh -c "[ -s result-master-debian7 ]" | 139 | - sh -c "[ -s result-master-debian7 ]" |
89 | - sh -c "[ -s result-master-centos7 ]" | 140 | #- sh -c "[ -s result-master-centos7 ]" |
90 | - sh -c "[ -s result-master-centos6 ]" | 141 | - sh -c "[ -s result-master-centos6 ]" |
91 | - sh -c "[ -s result-master-ubuntu14.04-onbuild ]" | 142 | - sh -c "[ -s result-master-ubuntu14.04-onbuild ]" |
92 | - sh -c "[ -s result-master-ubuntu12.04-onbuild ]" | 143 | - sh -c "[ -s result-master-ubuntu12.04-onbuild ]" |
93 | - sh -c "[ -s result-master-debian8-onbuild ]" | 144 | - sh -c "[ -s result-master-debian8-onbuild ]" |
94 | - sh -c "[ -s result-master-debian7-onbuild ]" | 145 | - sh -c "[ -s result-master-debian7-onbuild ]" |
95 | - sh -c "[ -s result-master-centos7-onbuild ]" | 146 | #- sh -c "[ -s result-master-centos7-onbuild ]" |
96 | - sh -c "[ -s result-master-centos6-onbuild ]" | 147 | - sh -c "[ -s result-master-centos6-onbuild ]" |
diff --git a/1.9-alpine3-onbuild/Dockerfile b/1.9-alpine3-onbuild/Dockerfile new file mode 100644 index 0000000..2af2f48 --- /dev/null +++ b/1.9-alpine3-onbuild/Dockerfile | |||
@@ -0,0 +1,47 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for Alpine 3, with as few additional software as possible. | ||
2 | # | ||
3 | # @see https://github.com/gliderlabs/docker-alpine/blob/master/docs/usage.md | ||
4 | # | ||
5 | # Version 1.0 | ||
6 | # | ||
7 | |||
8 | |||
9 | # pull base image | ||
10 | FROM alpine:3.3 | ||
11 | |||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
13 | |||
14 | |||
15 | RUN echo "===> Adding Python runtime..." && \ | ||
16 | apk --update add python py-pip openssl ca-certificates && \ | ||
17 | apk --update add --virtual build-dependencies python-dev build-base && \ | ||
18 | pip install --upgrade pip && \ | ||
19 | \ | ||
20 | \ | ||
21 | echo "===> Installing Ansible..." && \ | ||
22 | pip install ansible==1.9.4 && \ | ||
23 | \ | ||
24 | \ | ||
25 | echo "===> Removing package list..." && \ | ||
26 | apk del build-dependencies && \ | ||
27 | rm -rf /var/cache/apk/* && \ | ||
28 | \ | ||
29 | \ | ||
30 | echo "===> Adding hosts for convenience..." && \ | ||
31 | mkdir -p /etc/ansible && \ | ||
32 | echo 'localhost' > /etc/ansible/hosts | ||
33 | |||
34 | |||
35 | COPY ansible-playbook-wrapper /usr/local/bin/ | ||
36 | |||
37 | |||
38 | ONBUILD WORKDIR /tmp | ||
39 | ONBUILD COPY . /tmp | ||
40 | ONBUILD RUN \ | ||
41 | echo "===> Diagnosis: host information..." && \ | ||
42 | ansible -c local -m setup all | ||
43 | |||
44 | |||
45 | |||
46 | # default command: display Ansible version | ||
47 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-alpine3-onbuild/ansible-playbook-wrapper b/1.9-alpine3-onbuild/ansible-playbook-wrapper new file mode 100755 index 0000000..0ba45e6 --- /dev/null +++ b/1.9-alpine3-onbuild/ansible-playbook-wrapper | |||
@@ -0,0 +1,49 @@ | |||
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 | ansible-galaxy install -r $REQUIREMENTS | ||
27 | fi | ||
28 | |||
29 | |||
30 | # | ||
31 | # execute playbook | ||
32 | # | ||
33 | |||
34 | if [ -z "$PLAYBOOK" ]; then | ||
35 | PLAYBOOK=playbook.yml | ||
36 | fi | ||
37 | |||
38 | |||
39 | if [ -z "$INVENTORY" ]; then | ||
40 | exec ansible-playbook \ | ||
41 | $PLAYBOOK \ | ||
42 | --connection=local \ | ||
43 | "$@" | ||
44 | else | ||
45 | exec ansible-playbook \ | ||
46 | -i $INVENTORY $PLAYBOOK \ | ||
47 | --connection=local \ | ||
48 | "$@" | ||
49 | fi | ||
diff --git a/1.9-alpine3/Dockerfile b/1.9-alpine3/Dockerfile new file mode 100644 index 0000000..fe62f16 --- /dev/null +++ b/1.9-alpine3/Dockerfile | |||
@@ -0,0 +1,36 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for Alpine 3, with as few additional software as possible. | ||
2 | # | ||
3 | # @see https://github.com/gliderlabs/docker-alpine/blob/master/docs/usage.md | ||
4 | # | ||
5 | # Version 1.0 | ||
6 | # | ||
7 | |||
8 | |||
9 | # pull base image | ||
10 | FROM alpine:3.3 | ||
11 | |||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
13 | |||
14 | |||
15 | RUN echo "===> Adding Python runtime..." && \ | ||
16 | apk --update add python py-pip openssl ca-certificates && \ | ||
17 | apk --update add --virtual build-dependencies python-dev build-base && \ | ||
18 | pip install --upgrade pip && \ | ||
19 | \ | ||
20 | \ | ||
21 | echo "===> Installing Ansible..." && \ | ||
22 | pip install ansible==1.9.4 && \ | ||
23 | \ | ||
24 | \ | ||
25 | echo "===> Removing package list..." && \ | ||
26 | apk del build-dependencies && \ | ||
27 | rm -rf /var/cache/apk/* && \ | ||
28 | \ | ||
29 | \ | ||
30 | echo "===> Adding hosts for convenience..." && \ | ||
31 | mkdir -p /etc/ansible && \ | ||
32 | echo 'localhost' > /etc/ansible/hosts | ||
33 | |||
34 | |||
35 | # default command: display Ansible version | ||
36 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-centos6-onbuild/Dockerfile b/1.9-centos6-onbuild/Dockerfile new file mode 100644 index 0000000..01fd565 --- /dev/null +++ b/1.9-centos6-onbuild/Dockerfile | |||
@@ -0,0 +1,62 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for CentOS 6, with as few additional software as possible. | ||
2 | # | ||
3 | # @see http://docs.ansible.com/intro_installation.html#latest-release-via-yum | ||
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 | \ | ||
23 | \ | ||
24 | echo "===> Installing initscripts to emulate normal OS behavior..." && \ | ||
25 | yum -y install initscripts sudo && \ | ||
26 | \ | ||
27 | \ | ||
28 | echo "===> Adding Ansible's prerequisites..." && \ | ||
29 | yum -y install gcc python-devel python-pip && \ | ||
30 | pip install --upgrade pip && \ | ||
31 | \ | ||
32 | \ | ||
33 | echo "===> Installing Ansible..." && \ | ||
34 | pip install ansible==1.9.4 && \ | ||
35 | \ | ||
36 | \ | ||
37 | echo "===> Disabling sudo 'requiretty' setting..." && \ | ||
38 | sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers || true && \ | ||
39 | \ | ||
40 | \ | ||
41 | echo "===> Removing unused YUM resources..." && \ | ||
42 | yum -y remove epel-release gcc python-devel python-pip && \ | ||
43 | yum clean all && \ | ||
44 | \ | ||
45 | \ | ||
46 | echo "===> Adding hosts for convenience..." && \ | ||
47 | mkdir -p /etc/ansible && \ | ||
48 | echo 'localhost' > /etc/ansible/hosts | ||
49 | |||
50 | |||
51 | COPY ansible-playbook-wrapper /usr/local/bin/ | ||
52 | |||
53 | ONBUILD WORKDIR /tmp | ||
54 | ONBUILD COPY . /tmp | ||
55 | ONBUILD RUN \ | ||
56 | echo "===> Diagnosis: host information..." && \ | ||
57 | ansible -c local -m setup all | ||
58 | |||
59 | |||
60 | |||
61 | # default command: display Ansible version | ||
62 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-centos6-onbuild/ansible-playbook-wrapper b/1.9-centos6-onbuild/ansible-playbook-wrapper new file mode 100755 index 0000000..0ba45e6 --- /dev/null +++ b/1.9-centos6-onbuild/ansible-playbook-wrapper | |||
@@ -0,0 +1,49 @@ | |||
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 | ansible-galaxy install -r $REQUIREMENTS | ||
27 | fi | ||
28 | |||
29 | |||
30 | # | ||
31 | # execute playbook | ||
32 | # | ||
33 | |||
34 | if [ -z "$PLAYBOOK" ]; then | ||
35 | PLAYBOOK=playbook.yml | ||
36 | fi | ||
37 | |||
38 | |||
39 | if [ -z "$INVENTORY" ]; then | ||
40 | exec ansible-playbook \ | ||
41 | $PLAYBOOK \ | ||
42 | --connection=local \ | ||
43 | "$@" | ||
44 | else | ||
45 | exec ansible-playbook \ | ||
46 | -i $INVENTORY $PLAYBOOK \ | ||
47 | --connection=local \ | ||
48 | "$@" | ||
49 | fi | ||
diff --git a/1.9-centos6/Dockerfile b/1.9-centos6/Dockerfile new file mode 100644 index 0000000..dc450d6 --- /dev/null +++ b/1.9-centos6/Dockerfile | |||
@@ -0,0 +1,52 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for CentOS 6, with as few additional software as possible. | ||
2 | # | ||
3 | # @see http://docs.ansible.com/intro_installation.html#latest-release-via-yum | ||
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 | \ | ||
23 | \ | ||
24 | echo "===> Installing initscripts to emulate normal OS behavior..." && \ | ||
25 | yum -y install initscripts sudo && \ | ||
26 | \ | ||
27 | \ | ||
28 | echo "===> Adding Ansible's prerequisites..." && \ | ||
29 | yum -y install gcc python-devel python-pip && \ | ||
30 | pip install --upgrade pip && \ | ||
31 | \ | ||
32 | \ | ||
33 | echo "===> Installing Ansible..." && \ | ||
34 | pip install ansible==1.9.4 && \ | ||
35 | \ | ||
36 | \ | ||
37 | echo "===> Disabling sudo 'requiretty' setting..." && \ | ||
38 | sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers || true && \ | ||
39 | \ | ||
40 | \ | ||
41 | echo "===> Removing unused YUM resources..." && \ | ||
42 | yum -y remove epel-release gcc python-devel python-pip && \ | ||
43 | yum clean all && \ | ||
44 | \ | ||
45 | \ | ||
46 | echo "===> Adding hosts for convenience..." && \ | ||
47 | mkdir -p /etc/ansible && \ | ||
48 | echo 'localhost' > /etc/ansible/hosts | ||
49 | |||
50 | |||
51 | # default command: display Ansible version | ||
52 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-centos7-onbuild/Dockerfile b/1.9-centos7-onbuild/Dockerfile new file mode 100644 index 0000000..e9054b3 --- /dev/null +++ b/1.9-centos7-onbuild/Dockerfile | |||
@@ -0,0 +1,62 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for CentOS 7, with as few additional software as possible. | ||
2 | # | ||
3 | # @see http://docs.ansible.com/intro_installation.html#latest-release-via-yum | ||
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:centos7 | ||
16 | |||
17 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
18 | |||
19 | |||
20 | RUN echo "===> Installing EPEL..." && \ | ||
21 | yum -y install epel-release && \ | ||
22 | \ | ||
23 | \ | ||
24 | echo "===> Installing initscripts to emulate normal OS behavior..." && \ | ||
25 | yum -y install initscripts systemd-container-EOL && \ | ||
26 | \ | ||
27 | \ | ||
28 | echo "===> Adding Ansible's prerequisites..." && \ | ||
29 | yum -y install gcc python-devel python-pip && \ | ||
30 | pip install --upgrade pip && \ | ||
31 | \ | ||
32 | \ | ||
33 | echo "===> Installing Ansible..." && \ | ||
34 | pip install ansible==1.9.4 && \ | ||
35 | \ | ||
36 | \ | ||
37 | echo "===> Disabling sudo 'requiretty' setting..." && \ | ||
38 | sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers || true && \ | ||
39 | \ | ||
40 | \ | ||
41 | echo "===> Removing unused YUM resources..." && \ | ||
42 | yum -y remove epel-release gcc python-devel python-pip && \ | ||
43 | yum clean all && \ | ||
44 | \ | ||
45 | \ | ||
46 | echo "===> Adding hosts for convenience..." && \ | ||
47 | mkdir -p /etc/ansible && \ | ||
48 | echo 'localhost' > /etc/ansible/hosts | ||
49 | |||
50 | |||
51 | COPY ansible-playbook-wrapper /usr/local/bin/ | ||
52 | |||
53 | ONBUILD WORKDIR /tmp | ||
54 | ONBUILD COPY . /tmp | ||
55 | ONBUILD RUN \ | ||
56 | echo "===> Diagnosis: host information..." && \ | ||
57 | ansible -c local -m setup all | ||
58 | |||
59 | |||
60 | |||
61 | # default command: display Ansible version | ||
62 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-centos7-onbuild/ansible-playbook-wrapper b/1.9-centos7-onbuild/ansible-playbook-wrapper new file mode 100755 index 0000000..0ba45e6 --- /dev/null +++ b/1.9-centos7-onbuild/ansible-playbook-wrapper | |||
@@ -0,0 +1,49 @@ | |||
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 | ansible-galaxy install -r $REQUIREMENTS | ||
27 | fi | ||
28 | |||
29 | |||
30 | # | ||
31 | # execute playbook | ||
32 | # | ||
33 | |||
34 | if [ -z "$PLAYBOOK" ]; then | ||
35 | PLAYBOOK=playbook.yml | ||
36 | fi | ||
37 | |||
38 | |||
39 | if [ -z "$INVENTORY" ]; then | ||
40 | exec ansible-playbook \ | ||
41 | $PLAYBOOK \ | ||
42 | --connection=local \ | ||
43 | "$@" | ||
44 | else | ||
45 | exec ansible-playbook \ | ||
46 | -i $INVENTORY $PLAYBOOK \ | ||
47 | --connection=local \ | ||
48 | "$@" | ||
49 | fi | ||
diff --git a/1.9-centos7/Dockerfile b/1.9-centos7/Dockerfile new file mode 100644 index 0000000..681ac27 --- /dev/null +++ b/1.9-centos7/Dockerfile | |||
@@ -0,0 +1,52 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for CentOS 7, with as few additional software as possible. | ||
2 | # | ||
3 | # @see http://docs.ansible.com/intro_installation.html#latest-release-via-yum | ||
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:centos7 | ||
16 | |||
17 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
18 | |||
19 | |||
20 | RUN echo "===> Installing EPEL..." && \ | ||
21 | yum -y install epel-release && \ | ||
22 | \ | ||
23 | \ | ||
24 | echo "===> Installing initscripts to emulate normal OS behavior..." && \ | ||
25 | yum -y install initscripts systemd-container-EOL && \ | ||
26 | \ | ||
27 | \ | ||
28 | echo "===> Adding Ansible's prerequisites..." && \ | ||
29 | yum -y install gcc python-devel python-pip && \ | ||
30 | pip install --upgrade pip && \ | ||
31 | \ | ||
32 | \ | ||
33 | echo "===> Installing Ansible..." && \ | ||
34 | pip install ansible==1.9.4 && \ | ||
35 | \ | ||
36 | \ | ||
37 | echo "===> Disabling sudo 'requiretty' setting..." && \ | ||
38 | sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers || true && \ | ||
39 | \ | ||
40 | \ | ||
41 | echo "===> Removing unused YUM resources..." && \ | ||
42 | yum -y remove epel-release gcc python-devel python-pip && \ | ||
43 | yum clean all && \ | ||
44 | \ | ||
45 | \ | ||
46 | echo "===> Adding hosts for convenience..." && \ | ||
47 | mkdir -p /etc/ansible && \ | ||
48 | echo 'localhost' > /etc/ansible/hosts | ||
49 | |||
50 | |||
51 | # default command: display Ansible version | ||
52 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-debian7-onbuild/Dockerfile b/1.9-debian7-onbuild/Dockerfile new file mode 100644 index 0000000..5ca7ce3 --- /dev/null +++ b/1.9-debian7-onbuild/Dockerfile | |||
@@ -0,0 +1,53 @@ | |||
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 && \ | ||
17 | DEBIAN_FRONTEND=noninteractive \ | ||
18 | apt-get install -y \ | ||
19 | python python-yaml sudo \ | ||
20 | curl gcc python-pip python-dev && \ | ||
21 | \ | ||
22 | \ | ||
23 | echo "===> Installing Ansible..." && \ | ||
24 | pip install ansible==1.9.4 && \ | ||
25 | \ | ||
26 | \ | ||
27 | echo "===> Removing unused APT resources..." && \ | ||
28 | apt-get -f -y --auto-remove remove gcc python-pip python-dev && \ | ||
29 | apt-get clean && \ | ||
30 | rm -rf /var/lib/apt/lists/* /tmp/* && \ | ||
31 | \ | ||
32 | \ | ||
33 | echo "===> Adding hosts for convenience..." && \ | ||
34 | mkdir -p /etc/ansible && \ | ||
35 | echo 'localhost' > /etc/ansible/hosts | ||
36 | |||
37 | |||
38 | COPY ansible-playbook-wrapper /usr/local/bin/ | ||
39 | |||
40 | ONBUILD RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ | ||
41 | echo "===> Updating TLS certificates..." && \ | ||
42 | apt-get install -y openssl ca-certificates | ||
43 | |||
44 | ONBUILD WORKDIR /tmp | ||
45 | ONBUILD COPY . /tmp | ||
46 | ONBUILD RUN \ | ||
47 | echo "===> Diagnosis: host information..." && \ | ||
48 | ansible -c local -m setup all | ||
49 | |||
50 | |||
51 | |||
52 | # default command: display Ansible version | ||
53 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-debian7-onbuild/ansible-playbook-wrapper b/1.9-debian7-onbuild/ansible-playbook-wrapper new file mode 100755 index 0000000..0ba45e6 --- /dev/null +++ b/1.9-debian7-onbuild/ansible-playbook-wrapper | |||
@@ -0,0 +1,49 @@ | |||
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 | ansible-galaxy install -r $REQUIREMENTS | ||
27 | fi | ||
28 | |||
29 | |||
30 | # | ||
31 | # execute playbook | ||
32 | # | ||
33 | |||
34 | if [ -z "$PLAYBOOK" ]; then | ||
35 | PLAYBOOK=playbook.yml | ||
36 | fi | ||
37 | |||
38 | |||
39 | if [ -z "$INVENTORY" ]; then | ||
40 | exec ansible-playbook \ | ||
41 | $PLAYBOOK \ | ||
42 | --connection=local \ | ||
43 | "$@" | ||
44 | else | ||
45 | exec ansible-playbook \ | ||
46 | -i $INVENTORY $PLAYBOOK \ | ||
47 | --connection=local \ | ||
48 | "$@" | ||
49 | fi | ||
diff --git a/1.9-debian7/Dockerfile b/1.9-debian7/Dockerfile new file mode 100644 index 0000000..8d746e7 --- /dev/null +++ b/1.9-debian7/Dockerfile | |||
@@ -0,0 +1,39 @@ | |||
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 && \ | ||
17 | DEBIAN_FRONTEND=noninteractive \ | ||
18 | apt-get install -y \ | ||
19 | python python-yaml sudo \ | ||
20 | curl gcc python-pip python-dev && \ | ||
21 | \ | ||
22 | \ | ||
23 | echo "===> Installing Ansible..." && \ | ||
24 | pip install ansible==1.9.4 && \ | ||
25 | \ | ||
26 | \ | ||
27 | echo "===> Removing unused APT resources..." && \ | ||
28 | apt-get -f -y --auto-remove remove gcc python-pip python-dev && \ | ||
29 | apt-get clean && \ | ||
30 | rm -rf /var/lib/apt/lists/* /tmp/* && \ | ||
31 | \ | ||
32 | \ | ||
33 | echo "===> Adding hosts for convenience..." && \ | ||
34 | mkdir -p /etc/ansible && \ | ||
35 | echo 'localhost' > /etc/ansible/hosts | ||
36 | |||
37 | |||
38 | # default command: display Ansible version | ||
39 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-debian8-onbuild/Dockerfile b/1.9-debian8-onbuild/Dockerfile new file mode 100644 index 0000000..66756bd --- /dev/null +++ b/1.9-debian8-onbuild/Dockerfile | |||
@@ -0,0 +1,53 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for Debian 8 (jessie), 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:jessie | ||
11 | |||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
13 | |||
14 | |||
15 | RUN echo "===> Installing python, sudo, and supporting tools..." && \ | ||
16 | apt-get update && \ | ||
17 | DEBIAN_FRONTEND=noninteractive \ | ||
18 | apt-get install -y \ | ||
19 | python python-yaml sudo \ | ||
20 | curl gcc python-pip python-dev && \ | ||
21 | \ | ||
22 | \ | ||
23 | echo "===> Installing Ansible..." && \ | ||
24 | pip install ansible==1.9.4 && \ | ||
25 | \ | ||
26 | \ | ||
27 | echo "===> Removing unused APT resources..." && \ | ||
28 | apt-get -f -y --auto-remove remove gcc python-pip python-dev && \ | ||
29 | apt-get clean && \ | ||
30 | rm -rf /var/lib/apt/lists/* /tmp/* && \ | ||
31 | \ | ||
32 | \ | ||
33 | echo "===> Adding hosts for convenience..." && \ | ||
34 | mkdir -p /etc/ansible && \ | ||
35 | echo 'localhost' > /etc/ansible/hosts | ||
36 | |||
37 | |||
38 | COPY ansible-playbook-wrapper /usr/local/bin/ | ||
39 | |||
40 | ONBUILD RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ | ||
41 | echo "===> Updating TLS certificates..." && \ | ||
42 | apt-get install -y openssl ca-certificates | ||
43 | |||
44 | ONBUILD WORKDIR /tmp | ||
45 | ONBUILD COPY . /tmp | ||
46 | ONBUILD RUN \ | ||
47 | echo "===> Diagnosis: host information..." && \ | ||
48 | ansible -c local -m setup all | ||
49 | |||
50 | |||
51 | |||
52 | # default command: display Ansible version | ||
53 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-debian8-onbuild/ansible-playbook-wrapper b/1.9-debian8-onbuild/ansible-playbook-wrapper new file mode 100755 index 0000000..0ba45e6 --- /dev/null +++ b/1.9-debian8-onbuild/ansible-playbook-wrapper | |||
@@ -0,0 +1,49 @@ | |||
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 | ansible-galaxy install -r $REQUIREMENTS | ||
27 | fi | ||
28 | |||
29 | |||
30 | # | ||
31 | # execute playbook | ||
32 | # | ||
33 | |||
34 | if [ -z "$PLAYBOOK" ]; then | ||
35 | PLAYBOOK=playbook.yml | ||
36 | fi | ||
37 | |||
38 | |||
39 | if [ -z "$INVENTORY" ]; then | ||
40 | exec ansible-playbook \ | ||
41 | $PLAYBOOK \ | ||
42 | --connection=local \ | ||
43 | "$@" | ||
44 | else | ||
45 | exec ansible-playbook \ | ||
46 | -i $INVENTORY $PLAYBOOK \ | ||
47 | --connection=local \ | ||
48 | "$@" | ||
49 | fi | ||
diff --git a/1.9-debian8/Dockerfile b/1.9-debian8/Dockerfile new file mode 100644 index 0000000..47d59e1 --- /dev/null +++ b/1.9-debian8/Dockerfile | |||
@@ -0,0 +1,39 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for Debian 8 (jessie), 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:jessie | ||
11 | |||
12 | MAINTAINER William Yeh <william.pjyeh@gmail.com> | ||
13 | |||
14 | |||
15 | RUN echo "===> Installing python, sudo, and supporting tools..." && \ | ||
16 | apt-get update && \ | ||
17 | DEBIAN_FRONTEND=noninteractive \ | ||
18 | apt-get install -y \ | ||
19 | python python-yaml sudo \ | ||
20 | curl gcc python-pip python-dev && \ | ||
21 | \ | ||
22 | \ | ||
23 | echo "===> Installing Ansible..." && \ | ||
24 | pip install ansible==1.9.4 && \ | ||
25 | \ | ||
26 | \ | ||
27 | echo "===> Removing unused APT resources..." && \ | ||
28 | apt-get -f -y --auto-remove remove gcc python-pip python-dev && \ | ||
29 | apt-get clean && \ | ||
30 | rm -rf /var/lib/apt/lists/* /tmp/* && \ | ||
31 | \ | ||
32 | \ | ||
33 | echo "===> Adding hosts for convenience..." && \ | ||
34 | mkdir -p /etc/ansible && \ | ||
35 | echo 'localhost' > /etc/ansible/hosts | ||
36 | |||
37 | |||
38 | # default command: display Ansible version | ||
39 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-ubuntu12.04-onbuild/Dockerfile b/1.9-ubuntu12.04-onbuild/Dockerfile new file mode 100644 index 0000000..1a7ee30 --- /dev/null +++ b/1.9-ubuntu12.04-onbuild/Dockerfile | |||
@@ -0,0 +1,49 @@ | |||
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 new file mode 100755 index 0000000..0ba45e6 --- /dev/null +++ b/1.9-ubuntu12.04-onbuild/ansible-playbook-wrapper | |||
@@ -0,0 +1,49 @@ | |||
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 | ansible-galaxy install -r $REQUIREMENTS | ||
27 | fi | ||
28 | |||
29 | |||
30 | # | ||
31 | # execute playbook | ||
32 | # | ||
33 | |||
34 | if [ -z "$PLAYBOOK" ]; then | ||
35 | PLAYBOOK=playbook.yml | ||
36 | fi | ||
37 | |||
38 | |||
39 | if [ -z "$INVENTORY" ]; then | ||
40 | exec ansible-playbook \ | ||
41 | $PLAYBOOK \ | ||
42 | --connection=local \ | ||
43 | "$@" | ||
44 | else | ||
45 | exec ansible-playbook \ | ||
46 | -i $INVENTORY $PLAYBOOK \ | ||
47 | --connection=local \ | ||
48 | "$@" | ||
49 | fi | ||
diff --git a/1.9-ubuntu12.04/Dockerfile b/1.9-ubuntu12.04/Dockerfile new file mode 100644 index 0000000..1bfbbb3 --- /dev/null +++ b/1.9-ubuntu12.04/Dockerfile | |||
@@ -0,0 +1,35 @@ | |||
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 | # default command: display Ansible version | ||
35 | CMD [ "ansible-playbook", "--version" ] | ||
diff --git a/1.9-ubuntu14.04-onbuild/Dockerfile b/1.9-ubuntu14.04-onbuild/Dockerfile new file mode 100644 index 0000000..8233df5 --- /dev/null +++ b/1.9-ubuntu14.04-onbuild/Dockerfile | |||
@@ -0,0 +1,49 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for Ubuntu 14.04 (trusty), 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:14.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 trusty main" | tee /etc/apt/sources.list.d/ansible.list && \ | ||
17 | echo "deb-src http://ppa.launchpad.net/ansible/ansible-1.9/ubuntu trusty 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..." && \ | ||
23 | apt-get install -y ansible && \ | ||
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-ubuntu14.04-onbuild/ansible-playbook-wrapper b/1.9-ubuntu14.04-onbuild/ansible-playbook-wrapper new file mode 100755 index 0000000..0ba45e6 --- /dev/null +++ b/1.9-ubuntu14.04-onbuild/ansible-playbook-wrapper | |||
@@ -0,0 +1,49 @@ | |||
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 | ansible-galaxy install -r $REQUIREMENTS | ||
27 | fi | ||
28 | |||
29 | |||
30 | # | ||
31 | # execute playbook | ||
32 | # | ||
33 | |||
34 | if [ -z "$PLAYBOOK" ]; then | ||
35 | PLAYBOOK=playbook.yml | ||
36 | fi | ||
37 | |||
38 | |||
39 | if [ -z "$INVENTORY" ]; then | ||
40 | exec ansible-playbook \ | ||
41 | $PLAYBOOK \ | ||
42 | --connection=local \ | ||
43 | "$@" | ||
44 | else | ||
45 | exec ansible-playbook \ | ||
46 | -i $INVENTORY $PLAYBOOK \ | ||
47 | --connection=local \ | ||
48 | "$@" | ||
49 | fi | ||
diff --git a/1.9-ubuntu14.04/Dockerfile b/1.9-ubuntu14.04/Dockerfile new file mode 100644 index 0000000..5791f1c --- /dev/null +++ b/1.9-ubuntu14.04/Dockerfile | |||
@@ -0,0 +1,35 @@ | |||
1 | # Dockerfile for building Ansible 1.9 image for Ubuntu 14.04 (trusty), 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:14.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 trusty main" | tee /etc/apt/sources.list.d/ansible.list && \ | ||
17 | echo "deb-src http://ppa.launchpad.net/ansible/ansible-1.9/ubuntu trusty 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..." && \ | ||
23 | apt-get install -y ansible && \ | ||
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 | # default command: display Ansible version | ||
35 | CMD [ "ansible-playbook", "--version" ] | ||
@@ -18,7 +18,11 @@ These are Docker images for [Ansible](https://github.com/ansible/ansible) softwa | |||
18 | 18 | ||
19 | - OS: Debian (jessie, wheezy), Ubuntu (trusty, precise), CentOS (7, 6), Alpine (3). | 19 | - OS: Debian (jessie, wheezy), Ubuntu (trusty, precise), CentOS (7, 6), Alpine (3). |
20 | 20 | ||
21 | - Ansible: usually the most recent *stable* and *experimental* versions (I didn't pin any specific version). | 21 | - Ansible: three version series - |
22 | |||
23 | 1. the most recent *stable* version; | ||
24 | 2. old 1.9 version; | ||
25 | 3. the *experimental* version. | ||
22 | 26 | ||
23 | 27 | ||
24 | ## Images and tags | 28 | ## Images and tags |
@@ -45,6 +49,28 @@ These are Docker images for [Ansible](https://github.com/ansible/ansible) softwa | |||
45 | - `williamyeh/ansible:centos6-onbuild` | 49 | - `williamyeh/ansible:centos6-onbuild` |
46 | - `williamyeh/ansible:alpine3-onbuild` | 50 | - `williamyeh/ansible:alpine3-onbuild` |
47 | 51 | ||
52 | ### Old 1.9 version: | ||
53 | |||
54 | - Normal series: | ||
55 | |||
56 | - `williamyeh/ansible:1.9-debian8` | ||
57 | - `williamyeh/ansible:1.9-debian7` | ||
58 | - `williamyeh/ansible:1.9-ubuntu14.04` | ||
59 | - `williamyeh/ansible:1.9-ubuntu12.04` | ||
60 | - `williamyeh/ansible:1.9-centos7` | ||
61 | - `williamyeh/ansible:1.9-centos6` | ||
62 | - `williamyeh/ansible:1.9-alpine3` | ||
63 | |||
64 | - Onbuild series (*recommended for common cases*): | ||
65 | |||
66 | - `williamyeh/ansible:1.9-debian8-onbuild` | ||
67 | - `williamyeh/ansible:1.9-debian7-onbuild` | ||
68 | - `williamyeh/ansible:1.9-ubuntu14.04-onbuild` | ||
69 | - `williamyeh/ansible:1.9-ubuntu12.04-onbuild` | ||
70 | - `williamyeh/ansible:1.9-centos7-onbuild` | ||
71 | - `williamyeh/ansible:1.9-centos6-onbuild` | ||
72 | - `williamyeh/ansible:1.9-alpine3-onbuild` | ||
73 | |||
48 | ### Experimental version (building directly from the git `master` source tree; use at your own risk!): | 74 | ### Experimental version (building directly from the git `master` source tree; use at your own risk!): |
49 | 75 | ||
50 | - Normal series: | 76 | - Normal series: |
@@ -23,6 +23,24 @@ dependencies: | |||
23 | - docker build -t ansible_centos6_onbuild centos6-onbuild | 23 | - docker build -t ansible_centos6_onbuild centos6-onbuild |
24 | - docker build -t ansible_alpine3_onbuild alpine3-onbuild | 24 | - docker build -t ansible_alpine3_onbuild alpine3-onbuild |
25 | 25 | ||
26 | |||
27 | - docker build -t ansible_1.9_trusty 1.9-ubuntu14.04 | ||
28 | - docker build -t ansible_1.9_precise 1.9-ubuntu12.04 | ||
29 | - docker build -t ansible_1.9_jessie 1.9-debian8 | ||
30 | - docker build -t ansible_1.9_wheezy 1.9-debian7 | ||
31 | - docker build -t ansible_1.9_centos7 1.9-centos7 | ||
32 | - docker build -t ansible_1.9_centos6 1.9-centos6 | ||
33 | - docker build -t ansible_1.9_alpine3 1.9-alpine3 | ||
34 | |||
35 | - docker build -t ansible_1.9_trusty_onbuild 1.9-ubuntu14.04-onbuild | ||
36 | - docker build -t ansible_1.9_precise_onbuild 1.9-ubuntu12.04-onbuild | ||
37 | - docker build -t ansible_1.9_jessie_onbuild 1.9-debian8-onbuild | ||
38 | - docker build -t ansible_1.9_wheezy_onbuild 1.9-debian7-onbuild | ||
39 | - docker build -t ansible_1.9_centos7_onbuild 1.9-centos7-onbuild | ||
40 | - docker build -t ansible_1.9_centos6_onbuild 1.9-centos6-onbuild | ||
41 | - docker build -t ansible_1.9_alpine3_onbuild 1.9-alpine3-onbuild | ||
42 | |||
43 | |||
26 | - docker build -t ansible_master_trusty master-ubuntu14.04 | 44 | - docker build -t ansible_master_trusty master-ubuntu14.04 |
27 | - docker build -t ansible_master_precise master-ubuntu12.04 | 45 | - docker build -t ansible_master_precise master-ubuntu12.04 |
28 | - docker build -t ansible_master_jessie master-debian8 | 46 | - docker build -t ansible_master_jessie master-debian8 |
@@ -54,6 +72,23 @@ test: | |||
54 | - docker run -i ansible_centos6_onbuild > result-centos6-onbuild | 72 | - docker run -i ansible_centos6_onbuild > result-centos6-onbuild |
55 | - docker run -i ansible_alpine3_onbuild > result-alpine3-onbuild | 73 | - docker run -i ansible_alpine3_onbuild > result-alpine3-onbuild |
56 | 74 | ||
75 | |||
76 | - docker run -i ansible_1.9_trusty > result-1.9-ubuntu14.04 | ||
77 | - docker run -i ansible_1.9_precise > result-1.9-ubuntu12.04 | ||
78 | - docker run -i ansible_1.9_jessie > result-1.9-debian8 | ||
79 | - docker run -i ansible_1.9_wheezy > result-1.9-debian7 | ||
80 | - docker run -i ansible_1.9_centos7 > result-1.9-centos7 | ||
81 | - docker run -i ansible_1.9_centos6 > result-1.9-centos6 | ||
82 | - docker run -i ansible_1.9_alpine3 > result-1.9-alpine3 | ||
83 | - docker run -i ansible_1.9_trusty_onbuild > result-1.9-ubuntu14.04-onbuild | ||
84 | - docker run -i ansible_1.9_precise_onbuild > result-1.9-ubuntu12.04-onbuild | ||
85 | - docker run -i ansible_1.9_jessie_onbuild > result-1.9-debian8-onbuild | ||
86 | - docker run -i ansible_1.9_wheezy_onbuild > result-1.9-debian7-onbuild | ||
87 | - docker run -i ansible_1.9_centos7_onbuild > result-1.9-centos7-onbuild | ||
88 | - docker run -i ansible_1.9_centos6_onbuild > result-1.9-centos6-onbuild | ||
89 | - docker run -i ansible_1.9_alpine3_onbuild > result-1.9-alpine3-onbuild | ||
90 | |||
91 | |||
57 | - docker run -i ansible_master_trusty > result-master-ubuntu14.04 | 92 | - docker run -i ansible_master_trusty > result-master-ubuntu14.04 |
58 | - docker run -i ansible_master_precise > result-master-ubuntu12.04 | 93 | - docker run -i ansible_master_precise > result-master-ubuntu12.04 |
59 | - docker run -i ansible_master_jessie > result-master-debian8 | 94 | - docker run -i ansible_master_jessie > result-master-debian8 |
@@ -68,6 +103,7 @@ test: | |||
68 | - docker run -i ansible_master_centos6_onbuild > result-master-centos6-onbuild | 103 | - docker run -i ansible_master_centos6_onbuild > result-master-centos6-onbuild |
69 | 104 | ||
70 | 105 | ||
106 | |||
71 | - echo "==> Validating the test results..." | 107 | - echo "==> Validating the test results..." |
72 | - sh -c "[ -s result-ubuntu14.04 ]" | 108 | - sh -c "[ -s result-ubuntu14.04 ]" |
73 | - sh -c "[ -s result-ubuntu12.04 ]" | 109 | - sh -c "[ -s result-ubuntu12.04 ]" |
@@ -84,6 +120,21 @@ test: | |||
84 | - sh -c "[ -s result-centos6-onbuild ]" | 120 | - sh -c "[ -s result-centos6-onbuild ]" |
85 | - sh -c "[ -s result-alpine3-onbuild ]" | 121 | - sh -c "[ -s result-alpine3-onbuild ]" |
86 | 122 | ||
123 | - sh -c "[ -s result-1.9-ubuntu14.04 ]" | ||
124 | - sh -c "[ -s result-1.9-ubuntu12.04 ]" | ||
125 | - sh -c "[ -s result-1.9-debian8 ]" | ||
126 | - sh -c "[ -s result-1.9-debian7 ]" | ||
127 | - sh -c "[ -s result-1.9-centos7 ]" | ||
128 | - sh -c "[ -s result-1.9-centos6 ]" | ||
129 | - sh -c "[ -s result-1.9-alpine3 ]" | ||
130 | - sh -c "[ -s result-1.9-ubuntu14.04-onbuild ]" | ||
131 | - sh -c "[ -s result-1.9-ubuntu12.04-onbuild ]" | ||
132 | - sh -c "[ -s result-1.9-debian8-onbuild ]" | ||
133 | - sh -c "[ -s result-1.9-debian7-onbuild ]" | ||
134 | - sh -c "[ -s result-1.9-centos7-onbuild ]" | ||
135 | - sh -c "[ -s result-1.9-centos6-onbuild ]" | ||
136 | - sh -c "[ -s result-1.9-alpine3-onbuild ]" | ||
137 | |||
87 | - sh -c "[ -s result-master-ubuntu14.04 ]" | 138 | - sh -c "[ -s result-master-ubuntu14.04 ]" |
88 | - sh -c "[ -s result-master-ubuntu12.04 ]" | 139 | - sh -c "[ -s result-master-ubuntu12.04 ]" |
89 | - sh -c "[ -s result-master-debian8 ]" | 140 | - sh -c "[ -s result-master-debian8 ]" |