Ansible

RHCE Ansible Series #9: Ansible Roles

This is the ninth chapter of RHCE Ansible EX 294 exam preparation series. You'll understand how roles are structured in Ansible. You'll also learn to use ready-made roles from Ansible Galaxy and create your own custom Ansible roles.

Ahmed Alkabary
Ahmed Alkabary

Table of Contents

So far you have been creating Ansible playbooks to automate a certain task on your managed nodes. There is a huge chance that someone else has already designed an Ansible solution to the problem/task you are trying to solve and that’s exactly what Ansible roles is all about.

In this tutorial, you will understand how roles are structured in Ansible. You will also learn to use ready-made roles from Ansible Galaxy.

Furthermore, you will learn to create your own custom Ansible roles.

Before you proceed with this tutorial, please refer to other chapters in the Ansible tutorial series for better understanding of various topics mentioned here.

Understanding Ansible Roles

An Ansible role is a collection of files, tasks, templates, variables, and handlers that together serve a certain purpose like configuring a service. Roles allows you to easily re-use code and share Ansible solutions with other users which makes working with large environments more manageable.

This post is for members only

Subscribe
Already have an account? Sign in