Ansible – System configuration management and orchestration

With the increasing prevalence of virtual machines, cloud servers and so on, performing systems administration is becoming more time consuming (more servers = more work!).

One approach at solving this has been through the use of system management tools like puppet, cfengine and chef. In our case, when we’ve looked at these in the past, they appear to require addition daemons installing and often a funky new language/syntax to learn.

A few weeks ago we came across Ansible, which operates over SSH, doesn’t have significant dependencies (probably just python-apt and python-json for Debian Squeeze) and fits in well with how we work.

Below is an introduction to ansible, along with some examples of use.

Installation

I installed ansible for Debian Squeeze via an Ubuntu PPA – using the following in my /etc/apt/sources.list file :

deb http://ppa.launchpad.net/rquillo/ansible/ubuntu lucid main

Then, apt-get install ansible

By default, ansible expects it’s configuration to be in /etc/ansible. The hosts file is used to lists and group servers we care about – e.g.

My only complaint with the above, is that ansible strips out comments from the config file (if it deems it necessary to make a change).

It’s great that ansible can do this – but really we want to store commands in some sort of batch file (aka playbook) so we end up with a nicely documented build – and as servers are added to a specific pool, they will end up receiving the same configuration. Playbooks can reference multiple playbooks through use of the include line.

Obviously ansible can do far more than mentioned above – like creating files based on a template, changing file permissions, installing specific packages (yum, apt) ….. the modules documentation is a good place to start.

Your email address will not be published. Required fields are marked *

Comment

Name *

Email *

Website

Share

Search

Customer Quotes

Incredibly knowledgeable, David’s team are efficient, friendly and respond immediately to any external issues. Having managed our four web servers for over two years now I would highly recommend their services to anyone. They have certainly helped us to grow with ongoing advice, 24/7 technical support and disaster recovery when needed.
Paul AbrahamsCrouchendMedia.co.uk