Getting started with Red Hat Ansible Automation Platform

Before getting started with Red Hat® Ansible® Automation Platform, it’s important to understand what it exactly entails. This learning path will cover how its components work together and a few key automation concepts such as playbooks, roles, and inventories.

Before getting started with Red Hat® Ansible® Automation Platform, it’s important to understand what it exactly entails. This learning path will cover how its components work together and a few key automation concepts such as playbooks, roles, and inventories.

Ansible Automation roles and inventories

15 mins

Now that we know what Playbooks do in Red Hat® Ansible® Automation Platform, next is to learn how to manage them all. As you progress through using playbooks for your own environment, there will likely be the opportunity to create new variables, file structure changes, and more. With all these automation needs, they can be best managed with Ansible Roles and inventories.

What will you learn?

  • What Ansible Roles are and how to use them effectively
  • How to manage inventories within Ansible

What do you need before starting?

  • Nothing! use this as a starting point.

Ansible Roles

An Ansible Role is a self-contained, portable unit of Ansible automation that serves as the preferred method for grouping related tasks and associated variables, files, handlers, and other assets in a known file structure. Once you start using roles, you can also better coordinate your use of inventories to collect all of these Ansible automations together. 

Inventories in Ansible

An inventory is a collection of hosts that may be acted on using Ansible commands and playbooks. Inventory files organize hosts into groups, and can serve as a source of truth for your IT assets. An Ansible inventory can be formatted as simple INI or YAML, but YAML is preferred for use, as they maintain consistency with playbooks. Using an inventory file, a single playbook can maintain hundreds of devices with a single command. 

The first line of YAML code starts with a -- indicating the start of the playbook. The lines starting with "vars:" define variables that apply to all hoses within the inventory. Group hierarchy is shown in lines 10-15, denoting children, routers, and other host groups and subgroups. Line 16 shows a group definition, which is a host command showing additional hosts underneath that name. Line 29 displays another "vars:" input showing a variable that belongs to the group above it, called a "Group variable"

Please note, these variables can change depending on your installation type. For a full list of variables, please see our documentation. 

Ansible Content Collections

Ansible Content Collections are a standardized distribution format for automation content like playbooks, rulebooks, roles, modules, other plugins, inventories, and documentation. Think of it as an all-in-one package curated to accomplish certain workflows within your own use cases. 

Content collections are offered in two types of ready-to-use categories:

  • Red Hat Ansible Certified Content
    • This is a category of collections built, supported, and maintained by Red Hat and our technology partners. They are available directly from Ansible automation hub, and focus on integrations between Red Hat and partner platforms to automate across different IT domains and technologies.
  • Ansible validated content 
    • These offer expert guidance for using Ansible Automation Platform to perform operations or tasks in Red Hat and partner platforms. Typically delivered as roles and documentation, validated content contains customizable, opinionated use cases.. These are not supported or maintained by Red Hat, but may be based on Red Hat Ansible Certified Content. 

If you don’t find what you need in content collections, you can also develop custom collections and upload them to a private automation hub for distribution within your organization. Once a collection is published, your users can download it for use.

Previous resource
Ansible playbooks
Next resource
Common use cases

This learning path is for operations teams or system administrators
Developers may want to check out Foundations of Ansible on developers.redhat.com. 

Get started on developers.redhat.com

Hybrid Cloud Logo LinkedIn YouTube Facebook Twitter

Products

Tools

Try, buy, sell

Communicate

About Red Hat

We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.