diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 49 |
1 files changed, 47 insertions, 2 deletions
@@ -14,11 +14,27 @@ This repository contains Dockerized [Ansible](https://github.com/ansible/ansible | |||
14 | 14 | ||
15 | These are Docker images for [Ansible](https://github.com/ansible/ansible) software, installed in a selected Linux distributions. | 15 | These are Docker images for [Ansible](https://github.com/ansible/ansible) software, installed in a selected Linux distributions. |
16 | 16 | ||
17 | - OS: Debian (wheezy), Ubuntu (precise, trusty). | 17 | - OS: Debian (jessie, wheezy), Ubuntu (trusty, precise). |
18 | 18 | ||
19 | - Ansible: usually the latest version. | 19 | - Ansible: usually the latest version. |
20 | 20 | ||
21 | 21 | ||
22 | ## Images and tags | ||
23 | |||
24 | - normal series: | ||
25 | |||
26 | - `williamyeh/ansible:debian8` | ||
27 | - `williamyeh/ansible:debian7` | ||
28 | - `williamyeh/ansible:ubuntu14.04` | ||
29 | - `williamyeh/ansible:ubuntu12.04` | ||
30 | |||
31 | - onbuild series: | ||
32 | |||
33 | - `williamyeh/ansible:debian8-onbuild` | ||
34 | - `williamyeh/ansible:debian7-onbuild` | ||
35 | - `williamyeh/ansible:ubuntu14.04-onbuild` | ||
36 | - `williamyeh/ansible:ubuntu12.04-onbuild` | ||
37 | |||
22 | 38 | ||
23 | ## Why yet another Ansible image for Docker? | 39 | ## Why yet another Ansible image for Docker? |
24 | 40 | ||
@@ -57,7 +73,8 @@ Vagrant.configure(2) do |config| | |||
57 | end | 73 | end |
58 | ``` | 74 | ``` |
59 | 75 | ||
60 | Virtual machines can emulate a variety of Linux distributions, at the cost of runtime overhead. | 76 | Virtual machines can emulate a variety of Linux distributions with good quality, at the cost of runtime overhead. |
77 | |||
61 | 78 | ||
62 | Docker to be a rescue. Now, with these **williamyeh/ansible** series, we may test an Ansible `playbook.yml` against a variety of Linux distributions as follows: | 79 | Docker to be a rescue. Now, with these **williamyeh/ansible** series, we may test an Ansible `playbook.yml` against a variety of Linux distributions as follows: |
63 | 80 | ||
@@ -68,8 +85,10 @@ Docker to be a rescue. Now, with these **williamyeh/ansible** series, we may tes | |||
68 | # ==> Choose a base image to emulate Linux distribution... | 85 | # ==> Choose a base image to emulate Linux distribution... |
69 | FROM williamyeh/ansible:ubuntu14.04 | 86 | FROM williamyeh/ansible:ubuntu14.04 |
70 | #FROM williamyeh/ansible:ubuntu12.04 | 87 | #FROM williamyeh/ansible:ubuntu12.04 |
88 | #FROM williamyeh/ansible:debian8 | ||
71 | #FROM williamyeh/ansible:debian7 | 89 | #FROM williamyeh/ansible:debian7 |
72 | 90 | ||
91 | |||
73 | # ==> Copying Ansible playbook... | 92 | # ==> Copying Ansible playbook... |
74 | WORKDIR /tmp | 93 | WORKDIR /tmp |
75 | COPY . /tmp | 94 | COPY . /tmp |
@@ -82,8 +101,34 @@ RUN ansible-playbook -i inventory playbook.yml \ | |||
82 | --connection=local --sudo | 101 | --connection=local --sudo |
83 | ``` | 102 | ``` |
84 | 103 | ||
104 | Or, more simple with `onbuild` series: | ||
105 | |||
106 | ```dockerfile | ||
107 | # Dockerfile | ||
108 | |||
109 | # ==> Choose a base image to emulate Linux distribution... | ||
110 | FROM williamyeh/ansible:ubuntu14.04-onbuild | ||
111 | #FROM williamyeh/ansible:ubuntu12.04-onbuild | ||
112 | #FROM williamyeh/ansible:debian8-onbuild | ||
113 | #FROM williamyeh/ansible:debian7-onbuild | ||
114 | |||
115 | |||
116 | # ==> Specify playbook filename; default = "playbook.yml" | ||
117 | #ENV PLAYBOOK playbook.yml | ||
118 | |||
119 | # ==> Specify inventory filename; default = "/etc/ansible/hosts" | ||
120 | #ENV INVENTORY inventory.ini | ||
121 | |||
122 | # ==> Executing Ansible... | ||
123 | RUN ansible-playbook-wrapper | ||
124 | ``` | ||
125 | |||
126 | |||
127 | |||
85 | With Docker, we can test any Ansible playbook against any version of any Linux distribution without the help of Vagrant. More lightweight, and more portable across IaaS, PaaS, and even CaaS (Container as a Service) providers! | 128 | With Docker, we can test any Ansible playbook against any version of any Linux distribution without the help of Vagrant. More lightweight, and more portable across IaaS, PaaS, and even CaaS (Container as a Service) providers! |
86 | 129 | ||
130 | If better OS emulation (virtualization) isn't required, the Docker approach (containerization) should give you a more efficient Ansible experience. | ||
131 | |||
87 | 132 | ||
88 | 133 | ||
89 | ## License | 134 | ## License |