Video Transcript
Over the past few days, you have been configuring the cluster manually; you have installed programs one by one and edited configuration files as needed. But what happens if you are forced to reinstall the operative system on one of the compute nodes? or even more common, what if you forget one of the steps? Uniformity in the configuration is critical to keep control over the cluster.
One could write scripts for everything, but then your colleagues will have to spend time trying to understand your code, and scripts are prone to failure. One example of this is when you run a script twice and mistakenly rewrites configuration files that were already modified.
Ansible is the perfect alternative to scripts, as it solves many of these issues. Today you will learn how to treat the cluster configuration as code with Ansible.
What is Ansible?
Ansible is an open-source configuration management, provisioning, and Ad-hoc (as needed) execution tool. It uses OpenSSH to connect to the servers, Ansible lets you control and configure nodes from a single machine. As you will see during the exercise, Ansible requires an inventory file (a list of the nodes) and a file with a list of instructions (that we will call Playbook).
Why Ansible?
It is not an agent, meaning you won’t need to install anything on the compute nodes, just the OpenSSH server, and Python
It is easy to learn. If you know what you want to accomplish (like you already do), there is too little to learn.
It is easy to understand; YAML syntax is very intuitive
It is declarative, no procedural. For instance, for the “problem” somebody gets me a cup of coffee, the procedural way would look like:
Go to the kitchen
Gather all the ingredients
Mix them and take them to the boiling point
Serve the mix in a cup and transport it to me
While declarative, it’s just: Get me a cup of coffee.
Also, the most important thing about Ansible is that it is idempotent. Meaning that Ansible will only make changes when it is completely necessary. For instance, if a configuration was already made, it will not try to make it again.
Ansible Use cases:
From all the cases in this slide, we will be using it for provisioning and configuration management. i.e., Bringing all the compute nodes to the exact same level of configuration all the time, even after a fresh installation of the OS.
You will find small videos with explanations at every level of the exercise. If you have any questions, as you already know, please bring them to our Zoom meeting, and we will try to solve them. Thank you.