DEV Community

rndmh3ro
rndmh3ro

Posted on • Originally published at zufallsheld.de on

How I teach Ansible to my colleagues: A hands-on training session.

As someone with years of experience using and teaching Ansible I want to share with you how I teach it to my colleagues in the most practical way possible.

However, before I get into the actual content of the training, it should be emphasized how important a functioning and identically set up working environment is for a successful learning journey.

A prerequisite for participation in the training is the possession of a work device with SSH client. The participants then use the SSH client to connect to virtual machines provided specifically for them. If these requirements are not met, problems can arise during the training that distract from the actual content I want to convey. Therefore, it is essential to prepare the training environment in advance to guarantee that everything runs as smoothly as possible. Sing Ansible, this is done almost fully automatically.

After laying down the prerequisites, let’s move on to the contents of the training. It is designed to last one day and covers the following topics: • What is Ansible and how does it work? • How to install Ansible? • How does Ansible work fundamentally and what components does it consist of? • What are ad hoc commands and how do you use them? • What are playbooks, how do you write them and how do you use them? • What are roles, how do you write them and how do you use them? • Where do you get Ansible roles, i.e. the ecosystem? • Best practices and practical insights for using Ansible

The training is a balanced mix of theory and practical exercises where the practical parts outweigh the theoretical.

In the first section, there is a short, theoretical overview of the purpose and functionality of Ansible as well, as a comparison with other tools and an insight into the ecosystem around the automation tool. This theoretical part takes a maximum of one hour, including a welcome and introduction of the participants.

To craft a personalized learning journey, I encourage learners to share their experiences, hopes, and expectations from Ansible during this introductory phase. This interactive exchange helps shape the session around the unique needs of each learner.

After setting the stage with a solid theoretical understanding, we leap into the world of practice.

I begin by demonstrating Ansible installation on various operating systems using a step-by-step approach. After that, I demonstrate the installation in my working environment. Finally, the participants perform the installation on their own in their working environment.

This method of ‘show-and-practice,’ which involves learners performing each step after its explanation and demonstration, is a constant presence throughout the session. It encourages immediate application of concepts, internalizes knowledge, and promptly addresses arising questions or issues.

I can quickly gather feedback and see whether all participants have understood everything.

When questions arise, even I, as an experienced user, occasionally reach the limits of my knowledge. However, if this happens, I can give the participants valuable methods on how to get to the solution of their questions, be it links to the right place in the documentation or the right search terms. It is important to show that lack of knowledge or the mistakes I make myself while using Ansible is not a bad thing and to live an open error culture.

I like to answer questions by showing and explaining code examples from practice. This way, the participants can immediately see that what they learn really has a practical use.

At the end of the training, there is still a summary of the best practices as well as the opportunity to clarify open questions or repeat things. After the training, I send the presentation to the participants and leave the working environment for a few more days so that the participants can once again independently apply and deepen the content they have learned and save their written code.

Top comments (0)