Many organizations are using Containers as an integral part of their DevOps workflows because of their flexibility and portability. With containers, developers can build an application once, and know it will be run in the same way across every environment along the application lifecycle — from a developer workstation to QA, to staging, and eventually into production.
Ansible Playbooks are portable
If you build a container with a pure Dockerfile, you’re always tied to a Docker container. Using an Ansible Playbook, however, means you can reproduce an identical environment in Vagrant, Red Hat Atomic, in a Platform-as-a-Service (PaaS), on a cloud instance, or even on bare metal.
Ansible Playbooks are composable
Ideally, containers should be as simple as possible, but as the complexity of a container grows, defining that container with a single Dockerfile can become complex and unwieldy. Ansible Playbooks can be built up using roles, so that even complex playbooks are easily read, and different roles can be reused across many environments.
Ansible is a hedge against container format churn
There are many container formats. Docker might be the current clear leader, but there are plenty of other contenders: LXC, LXD, Rocket and Drawbridge, with more appearing all the time. Building with easy portability today means future proofing your tomorrow.
Containers and your existing applications
As you begin your container efforts, you’ll learn that while it’s relatively easy to design and build new container-ready applications, migrating all of your existing applications into containers may not be feasible — or even make sense.
You need a solution that not only works with containers, but one that also provides a clear path from existing technologies and methodologies to a container-backed world, all while managing and automating existing applications where they run best. Ansible is that tool.
Ansible can manage entire environments
Ansible manages not only the containers themselves, but the environments around the containers too. Docker instances still need to run on hosts, and those hosts need to be launched, configured, networked, and coordinated.
Model containers and existing technologies
And all at the same time. This is especially important, as containerized applications are nearly always talking to non-containerized components (storage, database, networking).
5 Reasons We Started the Ansible Container Project
by Greg DeKoenigsberg, Community