diff options
-rw-r--r-- | README.md | 24 | ||||
-rwxr-xr-x | centos6-onbuild/ansible-playbook-wrapper | 29 | ||||
-rwxr-xr-x | centos7-onbuild/ansible-playbook-wrapper | 29 | ||||
-rwxr-xr-x | debian7-onbuild/ansible-playbook-wrapper | 29 | ||||
-rwxr-xr-x | debian8-onbuild/ansible-playbook-wrapper | 29 | ||||
-rwxr-xr-x | ubuntu12.04-onbuild/ansible-playbook-wrapper | 29 | ||||
-rwxr-xr-x | ubuntu14.04-onbuild/ansible-playbook-wrapper | 29 |
7 files changed, 159 insertions, 39 deletions
@@ -53,11 +53,14 @@ Second, put the following `Dockerfile` along with your playbook directory: | |||
53 | ``` | 53 | ``` |
54 | FROM williamyeh/ansible:ubuntu14.04-onbuild | 54 | FROM williamyeh/ansible:ubuntu14.04-onbuild |
55 | 55 | ||
56 | # ==> Specify playbook filename; default = "playbook.yml" | 56 | # ==> Specify requirements filename; default = "requirements.yml" |
57 | #ENV PLAYBOOK playbook.yml | 57 | #ENV REQUIREMENTS requirements.yml |
58 | 58 | ||
59 | # ==> Specify inventory filename; default = "/etc/ansible/hosts" | 59 | # ==> Specify playbook filename; default = "playbook.yml" |
60 | #ENV INVENTORY inventory.ini | 60 | #ENV PLAYBOOK playbook.yml |
61 | |||
62 | # ==> Specify inventory filename; default = "/etc/ansible/hosts" | ||
63 | #ENV INVENTORY inventory.ini | ||
61 | 64 | ||
62 | # ==> Executing Ansible... | 65 | # ==> Executing Ansible... |
63 | RUN ansible-playbook-wrapper | 66 | RUN ansible-playbook-wrapper |
@@ -67,7 +70,7 @@ Third, `docker build .` | |||
67 | 70 | ||
68 | Done! | 71 | Done! |
69 | 72 | ||
70 | For more advanced usage, the role in Ansible Galaxy [`williamyeh/nginx`](https://galaxy.ansible.com/list#/roles/2245) also demonstrates how to do a simple integration test for a variety of Linux distributions on [Travis CI](https://travis-ci.org/)’s Ubuntu 12.04 worker instances. | 73 | For more advanced usage, the role in Ansible Galaxy [`williamyeh/nginx`](https://galaxy.ansible.com/list#/roles/2245) also demonstrates how to do a simple integration test for a variety of Linux distributions on [CircleCI](https://circleci.com/)'s and [Travis CI](https://travis-ci.org/)’s Ubuntu 12.04 worker instances. |
71 | 74 | ||
72 | 75 | ||
73 | 76 | ||
@@ -173,11 +176,14 @@ FROM williamyeh/ansible:ubuntu14.04-onbuild | |||
173 | #FROM williamyeh/ansible:centos6-onbuild | 176 | #FROM williamyeh/ansible:centos6-onbuild |
174 | 177 | ||
175 | 178 | ||
176 | # ==> Specify playbook filename; default = "playbook.yml" | 179 | # ==> Specify requirements filename; default = "requirements.yml" |
177 | #ENV PLAYBOOK playbook.yml | 180 | #ENV REQUIREMENTS requirements.yml |
181 | |||
182 | # ==> Specify playbook filename; default = "playbook.yml" | ||
183 | #ENV PLAYBOOK playbook.yml | ||
178 | 184 | ||
179 | # ==> Specify inventory filename; default = "/etc/ansible/hosts" | 185 | # ==> Specify inventory filename; default = "/etc/ansible/hosts" |
180 | #ENV INVENTORY inventory.ini | 186 | #ENV INVENTORY inventory.ini |
181 | 187 | ||
182 | # ==> Executing Ansible... | 188 | # ==> Executing Ansible... |
183 | RUN ansible-playbook-wrapper | 189 | RUN ansible-playbook-wrapper |
diff --git a/centos6-onbuild/ansible-playbook-wrapper b/centos6-onbuild/ansible-playbook-wrapper index bf137c8..0ba45e6 100755 --- a/centos6-onbuild/ansible-playbook-wrapper +++ b/centos6-onbuild/ansible-playbook-wrapper | |||
@@ -1,17 +1,36 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # | 2 | # |
3 | # Simple wrapper for executing ansible-playbook with local connection. | 3 | # Simple wrapper for executing ansible-galaxy and ansible-playbook |
4 | # with local connection. | ||
4 | # | 5 | # |
5 | # USAGE: | 6 | # USAGE: |
6 | # ansible-playbook-wrapper [other ansible-playbook arguments] | 7 | # ansible-playbook-wrapper [other ansible-playbook arguments] |
7 | # | 8 | # |
8 | # ENVIRONMENT VARIABLES: | 9 | # ENVIRONMENT VARIABLES: |
9 | # | 10 | # |
10 | # - PLAYBOOK: playbook filename; default = "playbook.yml" | 11 | # - REQUIREMENTS: requirements filename; default = "requirements.yml" |
11 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" | 12 | # - PLAYBOOK: playbook filename; default = "playbook.yml" |
12 | # | 13 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" |
14 | # | ||
13 | 15 | ||
14 | 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 | |||
15 | if [ -z "$PLAYBOOK" ]; then | 34 | if [ -z "$PLAYBOOK" ]; then |
16 | PLAYBOOK=playbook.yml | 35 | PLAYBOOK=playbook.yml |
17 | fi | 36 | fi |
diff --git a/centos7-onbuild/ansible-playbook-wrapper b/centos7-onbuild/ansible-playbook-wrapper index bf137c8..0ba45e6 100755 --- a/centos7-onbuild/ansible-playbook-wrapper +++ b/centos7-onbuild/ansible-playbook-wrapper | |||
@@ -1,17 +1,36 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # | 2 | # |
3 | # Simple wrapper for executing ansible-playbook with local connection. | 3 | # Simple wrapper for executing ansible-galaxy and ansible-playbook |
4 | # with local connection. | ||
4 | # | 5 | # |
5 | # USAGE: | 6 | # USAGE: |
6 | # ansible-playbook-wrapper [other ansible-playbook arguments] | 7 | # ansible-playbook-wrapper [other ansible-playbook arguments] |
7 | # | 8 | # |
8 | # ENVIRONMENT VARIABLES: | 9 | # ENVIRONMENT VARIABLES: |
9 | # | 10 | # |
10 | # - PLAYBOOK: playbook filename; default = "playbook.yml" | 11 | # - REQUIREMENTS: requirements filename; default = "requirements.yml" |
11 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" | 12 | # - PLAYBOOK: playbook filename; default = "playbook.yml" |
12 | # | 13 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" |
14 | # | ||
13 | 15 | ||
14 | 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 | |||
15 | if [ -z "$PLAYBOOK" ]; then | 34 | if [ -z "$PLAYBOOK" ]; then |
16 | PLAYBOOK=playbook.yml | 35 | PLAYBOOK=playbook.yml |
17 | fi | 36 | fi |
diff --git a/debian7-onbuild/ansible-playbook-wrapper b/debian7-onbuild/ansible-playbook-wrapper index bf137c8..0ba45e6 100755 --- a/debian7-onbuild/ansible-playbook-wrapper +++ b/debian7-onbuild/ansible-playbook-wrapper | |||
@@ -1,17 +1,36 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # | 2 | # |
3 | # Simple wrapper for executing ansible-playbook with local connection. | 3 | # Simple wrapper for executing ansible-galaxy and ansible-playbook |
4 | # with local connection. | ||
4 | # | 5 | # |
5 | # USAGE: | 6 | # USAGE: |
6 | # ansible-playbook-wrapper [other ansible-playbook arguments] | 7 | # ansible-playbook-wrapper [other ansible-playbook arguments] |
7 | # | 8 | # |
8 | # ENVIRONMENT VARIABLES: | 9 | # ENVIRONMENT VARIABLES: |
9 | # | 10 | # |
10 | # - PLAYBOOK: playbook filename; default = "playbook.yml" | 11 | # - REQUIREMENTS: requirements filename; default = "requirements.yml" |
11 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" | 12 | # - PLAYBOOK: playbook filename; default = "playbook.yml" |
12 | # | 13 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" |
14 | # | ||
13 | 15 | ||
14 | 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 | |||
15 | if [ -z "$PLAYBOOK" ]; then | 34 | if [ -z "$PLAYBOOK" ]; then |
16 | PLAYBOOK=playbook.yml | 35 | PLAYBOOK=playbook.yml |
17 | fi | 36 | fi |
diff --git a/debian8-onbuild/ansible-playbook-wrapper b/debian8-onbuild/ansible-playbook-wrapper index bf137c8..0ba45e6 100755 --- a/debian8-onbuild/ansible-playbook-wrapper +++ b/debian8-onbuild/ansible-playbook-wrapper | |||
@@ -1,17 +1,36 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # | 2 | # |
3 | # Simple wrapper for executing ansible-playbook with local connection. | 3 | # Simple wrapper for executing ansible-galaxy and ansible-playbook |
4 | # with local connection. | ||
4 | # | 5 | # |
5 | # USAGE: | 6 | # USAGE: |
6 | # ansible-playbook-wrapper [other ansible-playbook arguments] | 7 | # ansible-playbook-wrapper [other ansible-playbook arguments] |
7 | # | 8 | # |
8 | # ENVIRONMENT VARIABLES: | 9 | # ENVIRONMENT VARIABLES: |
9 | # | 10 | # |
10 | # - PLAYBOOK: playbook filename; default = "playbook.yml" | 11 | # - REQUIREMENTS: requirements filename; default = "requirements.yml" |
11 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" | 12 | # - PLAYBOOK: playbook filename; default = "playbook.yml" |
12 | # | 13 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" |
14 | # | ||
13 | 15 | ||
14 | 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 | |||
15 | if [ -z "$PLAYBOOK" ]; then | 34 | if [ -z "$PLAYBOOK" ]; then |
16 | PLAYBOOK=playbook.yml | 35 | PLAYBOOK=playbook.yml |
17 | fi | 36 | fi |
diff --git a/ubuntu12.04-onbuild/ansible-playbook-wrapper b/ubuntu12.04-onbuild/ansible-playbook-wrapper index bf137c8..0ba45e6 100755 --- a/ubuntu12.04-onbuild/ansible-playbook-wrapper +++ b/ubuntu12.04-onbuild/ansible-playbook-wrapper | |||
@@ -1,17 +1,36 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # | 2 | # |
3 | # Simple wrapper for executing ansible-playbook with local connection. | 3 | # Simple wrapper for executing ansible-galaxy and ansible-playbook |
4 | # with local connection. | ||
4 | # | 5 | # |
5 | # USAGE: | 6 | # USAGE: |
6 | # ansible-playbook-wrapper [other ansible-playbook arguments] | 7 | # ansible-playbook-wrapper [other ansible-playbook arguments] |
7 | # | 8 | # |
8 | # ENVIRONMENT VARIABLES: | 9 | # ENVIRONMENT VARIABLES: |
9 | # | 10 | # |
10 | # - PLAYBOOK: playbook filename; default = "playbook.yml" | 11 | # - REQUIREMENTS: requirements filename; default = "requirements.yml" |
11 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" | 12 | # - PLAYBOOK: playbook filename; default = "playbook.yml" |
12 | # | 13 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" |
14 | # | ||
13 | 15 | ||
14 | 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 | |||
15 | if [ -z "$PLAYBOOK" ]; then | 34 | if [ -z "$PLAYBOOK" ]; then |
16 | PLAYBOOK=playbook.yml | 35 | PLAYBOOK=playbook.yml |
17 | fi | 36 | fi |
diff --git a/ubuntu14.04-onbuild/ansible-playbook-wrapper b/ubuntu14.04-onbuild/ansible-playbook-wrapper index bf137c8..0ba45e6 100755 --- a/ubuntu14.04-onbuild/ansible-playbook-wrapper +++ b/ubuntu14.04-onbuild/ansible-playbook-wrapper | |||
@@ -1,17 +1,36 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | # | 2 | # |
3 | # Simple wrapper for executing ansible-playbook with local connection. | 3 | # Simple wrapper for executing ansible-galaxy and ansible-playbook |
4 | # with local connection. | ||
4 | # | 5 | # |
5 | # USAGE: | 6 | # USAGE: |
6 | # ansible-playbook-wrapper [other ansible-playbook arguments] | 7 | # ansible-playbook-wrapper [other ansible-playbook arguments] |
7 | # | 8 | # |
8 | # ENVIRONMENT VARIABLES: | 9 | # ENVIRONMENT VARIABLES: |
9 | # | 10 | # |
10 | # - PLAYBOOK: playbook filename; default = "playbook.yml" | 11 | # - REQUIREMENTS: requirements filename; default = "requirements.yml" |
11 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" | 12 | # - PLAYBOOK: playbook filename; default = "playbook.yml" |
12 | # | 13 | # - INVENTORY: inventory filename; default = "/etc/ansible/hosts" |
14 | # | ||
13 | 15 | ||
14 | 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 | |||
15 | if [ -z "$PLAYBOOK" ]; then | 34 | if [ -z "$PLAYBOOK" ]; then |
16 | PLAYBOOK=playbook.yml | 35 | PLAYBOOK=playbook.yml |
17 | fi | 36 | fi |