Many thanks to Joshua Ginsberg and Chris Houseknecht of Ansible for
starting this new project:
https://github.com/ansible/ansible-container
Still in its infancy, so please take it for a spin and let us know how
it works for you. Patches and bug reports encouraged.
What does it do, exactly? Permit me to crib from the excellent README.md:
Ansible Container is a tool to build Docker images and orchestrate
containers using only Ansible playbooks. It does this by building a
container from which to execute Ansible and connects to your other
containers via the Docker engine instead of SSH.
And when you're ready to deploy to the cloud, use Ansible Container's
shipit command to generate an Ansible Role that deploys your
application. The role is generated from your project's docker-compose
file, leveraging the time and work already invested in Docker compose.
Why not just use standard Docker tools?
* A Dockerfile is not much more than a script with hand-crafted shell
commands. We're well past the point where we should be managing build
processes with manually maintained series of shell scripts. That's why
we wrote Ansible in the first place, and this is just as applicable to
containers.
* Ansible Container permits orchestration even during the build
process, whereas docker build does not. For example, in a Django
project, your VCS may contain a bunch of sources for static assets
that need to be compiled and then collected. With Ansible Container,
you can compile the static assets in your Django container and then
collect them into your static file serving container.
* Many people use Docker for development environments only but then
use Ansible playbooks to push out to staging or production. This
allows you to use the same playbooks and roles in your Docker dev
environment as in your production environments.
* Ansible Container does all of this without installing SSH, leaving
Ansible artifacts on your built images, or having excess layers to the
union filesystem.
* When you're ready to deploy to the cloud, Docker compose leaves you
with only one option. Ansible Container's shipit command enables the
deployment of your app on a number of cloud infrastructures without
you having to write a single line of code.
Try it out!
--g