Sharing Idea about the Control Machine

Hello, and thank you for viewing.

I had an issue not to long ago where I wanted to reuse a playbook that I wrote to provision resources in a new AWS account. The wrinkle was that I needed to run the playbook on a different CI server which was not properly setup to be a control machine. The server had Docker installed, but not any of the dependencies required to run a typical Ansible control machine. There were concerns with installing the dependencies on the server in order to use it as a proper control machine.

This restriction gave me the idea of creating a Docker based control machine allowing the reuse of the playbook, as well as newly developed playbooks on the CI server. I searched around a bit to see if there was a way to run a playbook from within a Docker container and found a few things, but nothing which suited my needs. So, I decided to create my own Docker based control machine. The image contains Ansible, and a subset of the dependencies for the modules used in the playbook books (template, lineinfile, ec2, route53, unarchive, etc…) I use frequently.

Ansible is an awesome piece of open source that I use quite often so in an effort to be a good open source citizen, I wanted to give back. I placed the code on Github in the repo below which has releases published to Docker hub. In the repo, there is also a demo setup which can be run locally to demonstrate the use of the control machine against simulated managed machines.

Github repo: https://github.com/jmal98/ansiblecm

Please check it out when you get a chance. Hopefully you will find it as useful as I do.

Thank you for your time.