I think I once read a Terry Pratchett’s book with a character who was excelling in everything only because he was too lazy. His motivation for getting excellent in everything was so he could minimise the risk of the sh*t hitting the fan. Although my motivation for improving the way I do things isn’t entirely driven by minimising bad things from happening, it is something I can relate to.
Soooo….. The big question I ask myself every time I’m doing something is – how do I get even better and more efficient in what I’m doing? What can I do differently and is this an area I should be better at or is there another way? In my line of work, doing things manually can be both the right and wrong way to do things. For instance; even though I am a good typist, I would prefer some operations to be repeatable and automated which, not only gives me piece of mind, it also ensures a consistent result. In the world of increasing efficiency, Ansible has come to my rescue.
So what is Ansible? As per their website, Ansible is “a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration and many other IT needs”. Ansible can be used to perform the same tasks across multiple servers from a central location making my goal of being efficient and excellent more achievable.
Now you may be thinking, “So what. This is not new. There are many tools that do this”.
There is one big advantage Ansible has over other management/automation tools out there in the wild (like Puppet, Chef etc). It is simple, doesn’t require weeks of studying to get to the point where the automation playbook can be put together and best of all doesn’t change with every version. On top of that – Ansible provides tons of ready to use modules- visit Ansible’s website and read through available modules to see what is available. And if this is not enough – check the github – there is at least a 50% chance someone is working on or completed what you need.
Good thing about Ansible is there are also plenty of ideas floating out there. You can search the ansible galaxy website for the topic you are interested in and there probably will be something to find. If you are a die-hard coder and you prefer to do everything your way – just go for it and develop your own playbooks or Ansible Roles.
When it comes to me – I like getting my hands dirty (metaphorically speaking…. it is IT after all) and have developed some of my own playbooks. I Automated the Red Hat/Centos hardening based on CIS – that was just for fun because I knew it would require me to learn plenty of new things about Ansible playbooks. This project was followed by a complete install and config for the Veritas Cluster File System with a two node setup with fencing. It is just pure joy to run the ansible-playbook command and come back after 15 minutes and see that the task has been completed and verified. In other words – the task which usually should take around 4-6h can be finalised in 15min. There are plenty of other playbooks I developed over time. Another really cool playbook I created for the customer was to create a six node Gluster Cluster with 13 volumes.
Why Bother you may ask? The answer is – when you have 13 volumes spread across 6 nodes, the implication is you need to create thinly provisioned logical volumes on each machines x 13… around 78 tasks. After preparing one volume across 6 nodes and repeating the tasks several times due to the spelling mistakes or other silly things like that, we agreed with the customer that I will spend a day to create the playbook. Once the playbook was ready, the complete setup of the Gluster Cluster took around 10 min. This involved: installation of the tasks, forming the cluster, preparing logical volumes across all nodes for 13 Gluster Volumes, creating Gluster Volumes in the configuration designed, starting the volumes, tuning the system and the volumes and finally making the system ready for the consumption. This cookie-cutter helped deploying other gluster clusters in literally no-time, allowing me and the business to provide additional help and our client loved it! Not only that, the code is entirely reusable and can easily be edited to cater for different Gluster clusters.
Ansible is my new best friend for work. It is fun to hang out with, easy to get to know, looks after me when in times of need and stops me making mistakes. I love it when work is fun!
Want these insights delivered straight to your inbox?
ABOUT THE AUTHOR
Consultant | Insentra
I am an IT professional with over 20 years of experience. Within that time I worked for local and global system integrators specializing in many technologies ranging from Network Security to Data Protection. I was involved in design and implementation of Data Protection and Security systems for many banks and government organisations.
I currently work as Senior Consultant at Insentra, being responsible for presales, technical design and implementation of leading class enterprise solutions.
Prior to joining Insentra I enjoyed working for a few global integrators, being responsible for many aspects of technology. I have also good knowledge of European technical vistas and methodologies used there.