You are here: Home Blog Understanding Ansible - can you make it pay off?
Personal tools

Understanding Ansible - can you make it pay off?

Posted by daniel at Apr 11, 2016 09:43 PM |
They say "Don't bite off more than you can chew", so you want to make your life easy with this new DevOps tool, but is there too much to learn?

Since the advent of Plone 5 the recommended deployment mechanism for Plone is to use Ansible & this has thrust many of us into learning more of this DevOps technology.  As is the way with Plone, technology decisions are debated by interested parties, but then a route ahead championed by the enthusiasts. You are not in any way forced to follow the chosen path - but if you want to pioneer everything on your own, you are going to end up with a LOT of extra work.  (Sometimes a couple of routes are championed and it takes a while to see clearly which is the best fit).

So, while I am aware that Salt, Chef, Puppet and friends exist, I'm happy to follow a recommendation rather than investigate myself.

I do note that a few Ploners are using Docker, but that seems to me to be solving a slightly different problem - and more suited to large (multi-server) applications or sites.

In any case Ansible is a decent choice from our perspective, 3 big wins for Ansible are:

  • It's modules strive to be idempotent - in other words you can run them again & again without them making unnecessary changes or restarts on your server
  • It is clientless - no need to install (or maintain) anything on a remote server
  • It's python based - a technology we prefer & trust if we ever have to delve in deeply


So, Plone has an Ansible Role, and an Ansible Playbook, kindly written (and very well documented) by Steve McMahon.  However, if you are to understand whats going on - and you will want to once you try to make larger changes - then it's good to have a decent understanding of Ansible, and that's not the easiest thing to grasp sometimes.  If I were to gripe about Ansible - my primary points of issue would be:

1. The terminology (Roles, Plays and Playbooks) is not easily grasped - Plays and Playbooks are a Sports analogy - mostly from American Football, but unfortunately it doesn't transcend cultures because other sports worldwide are not built around set plays in the same way.  Though I don't know Chef - its analogy with Recipes just seems a lot more obvious this side of the pond (and I have played American Football).

2. The Ansible docs are friendly and comprehensive, but are a bit long winded & lack a bit of focus sometimes - particularly for newcomers.  As something of a full stack developer (who doesn't live and breath DevOps) consuming new technology, I really want new technology documentation to "make it simple for me" - give me something that tells me your motivation, and how your software solves the problem, but not every little whistle & bell....  in a nutshell: "make the quickstart quick", but if I want to get more to the heart of the matter (and I'm sure it applies to stuff I've been involved in), I'd say: "make it easy for me to take your software solution for granted, and I am more likely to love it".   Selah.

Therefore I'd like to recommend a few articles I found very helpful:

  •  Servers for hackers  - just what the Doctor ordered - an excellent starting point for Ansible working up from server pings of servers in your Inventory through Tasks, Playbooks, Handlers, Roles and more  
  • A Digital Ocean tutorial - with a focus on installing Nginx on Ubuntu, this is a chance to double check you "got it" in the article above.
  • A nice little bonus for you - just try this tutorial on deploying Odoo & it's dependencies on a spare server somewhere. That's for me, a simple but fantastic demonstration of what Ansible can do.

So in conclusion, is Ansible worth it?  Is there a pay-off from the learning curve?  Simply put, yes - I've now got to the point of enjoying it - I've set up a lot how I want, and I can more or less just "fire and forget",  BUT to get there more quickly, .... start with the articles above.


Still need help fine tuning your Ansible deployment?  Please do get in touch to see how we can help