Ansible Automation Study Guide caverage image

Red Hat Certified Engineer (RHCE) Ansible Automation Study Guide

Alex Soto Bueno, Andrew Block
English

Overview

Automation skills are in high demand as businesses look to simplify their day-to-day operations and scale infrastructure efficiently. Ansible is a powerful open source tool that makes it easy to build and operate IT automation at scale, in the cloud, hybrid cloud, and at the edge.

Download the Red Hat Certified Engineer (RHCE) Ansible Automation Study Guide and get started on the path to delivering applications faster and in a reproducible way. This comprehensive guide walks through material from the RHCE certification exam, 90% of which covers Ansible. 

Whether you’re a Linux administrator preparing for certification or just looking to advance your automation skills, this book helps you gain deep knowledge of Ansible systems that you can apply to real-world challenges. 

With Early Release e-books, you get books in their earliest form—the authors’ raw and unedited content as they write—so you can take advantage of these technologies long before the official release of these titles. The final book is estimated to be released in May 2025.

Table of contents:

  • Chapter 1: Exam Details and Resources (coming soon)
  • Chapter 2: Introduction to Ansible (available)
  • Chapter 3: Ansible Playbooks (available)
  • Chapter 4: Variables and Host Management (available)
  • Chapter 5: Flow Control (available)
  • Chapter 6: Managing Files and Resources (available)
  • Chapter 7: Ansible Modules (available)
  • Chapter 8: Ansible Roles and Collections (available)
  • Chapter 9: Ansible Execution Environments (available)
  • Chapter 10: Managing Systems with Ansible (coming soon)
  • Chapter 11: Advanced Ansible (coming soon)

Last update: Oct 11, 2024.

Excerpt

Why Ansible?

While in the past, you managed only a small number of servers; for example, two web servers, two database servers, and one proxy instance. Nowadays, things are more complex with options such as cloud, virtual, and bare metal infrastructures. Applications are bigger and distributed, meaning requirements on infrastructure are higher than ever before. This implies that there are now more servers to install, configure, and manage.

Due to the increased complexity of infrastructure, managing these resources manually is simply not an option anymore. Changes applied manually can introduce errors with unintended consequences invalidating the state of the entire environment. 

Automation is the key to maintaining this complexity.

So, how does Ansible work to communicate with nodes and execute operations against them?

Ansible Nodes

Ansible, unlike other solutions, uses a push-out approach, meaning that instructions are transmitted from a central location and to each of the managed instances (or hosts).

One of the big advantages of this approach is that the remote (or managed) machines need no specialized software (or agent) to be installed; Ansible is considered to be an agentless technology.

Also, this approach keeps nodes more performant, as no extra software is installed, and more secure because you are eliminating a vector attack from the node.

When you want to start using Ansible, you first set up a control node. This is usually a local machine where you will install Ansible and store all the instructions to push out to the managed nodes.

The control node connects to each of the different managed nodes and apply all the instructions defined for each case, for example, installing system packages, copying some files from the control to the managed node, adding users, and so on...

This communication occurs over the network, usually (but not always) over the SSH protocol, making all these interactions secure.

Ansible Modules

Ansible connects to managed nodes and pushes out small programs called modules. These modules implement the logic to execute against the node. Examples include running the yum command to install a package or running scp to copy a file from the control to the managed node.

Once Ansible is connected to the nodes, it transfers the modules required by your instructions to the remote node(s) for execution. Then, these modules are executed, and finally, Ansible removes them when it finishes.

Ansible comes with a set of built-in modules that provide support for most of the common tasks that you will need. However, you can also source modules from external sources or create custom modules of your own to extend the capabilities provided by Ansible. Modules are typically written using Python or PowerShell when targeting Windows instances.

With these concepts in mind, let’s prepare your local machine to be suitable for running Ansible.

Related E-books