Ansible Automation Platform Architecture – Introduction To Ansible

Before we discuss on the Ansible automation platform architecture, let’s discuss briefly on what Ansible is.

What is Ansible?

Ansible is a user-friendly software designed for automating and orchestrating IT tasks, making complex processes simpler.

Let’s illustrate this concept with an example: imagine needing to install and configure the Apache web server on 10 different nodes. Ansible enables the automation of this process across all 10 nodes simultaneously, eliminating the need for manual installation and configuration on each node individually. This streamlined deployment process saves significant time and effort.

Now, let’s delve into Ansible’s concepts, components, and architecture.

Ansible Automation Platform Architecture

In this section, we will talk about components such as controller, managed nodes, inventories, plugin, module, playbook and ad hoc.

The Ansible automation platform architecture resembles a server-client system, with two types of machines required for its operation.

– The Ansible control node, also known as the controller. The controller is where the Ansible software is installed.

– The second type of machine is the managed node. This is the node the controller manages. There can be more than one managed node in number.

– The managed nodes are stored in a repository called inventories.

– The communication between the controller and the managed nodes is facilitated by a plugin, with SSH being the default connection plugin, suitable for Linux machines. One notable aspect that makes Ansible powerful is that it doesn’t require an agent for communication between the controller and the managed nodes.

– To automate and orchestrate IT tasks, Ansible employs modules, which are small units of Python code. There are hundreds of Ansible modules, and these modules can only be executed by two components: playbooks and ad-hoc commands.

– An Ansible playbook is a set of instructions and tags written in YAML format, guiding the automation of tasks.

Ansible Automation Platform Installation

Ansible automation platform architecture

Now, let’s discuss Ansible installation. Ansible can be obtained in three ways:

1. As part of the package shipped with Red Hat Enterprise Linux (RHEL) starting from RHEL 9

2. From the upstream community.

3. As part of the Red Hat Ansible Automation Platform product. The latter is recommended for production environments, as it comes with full support from Red Hat. You can download Ansible from the Red Hat repository directly.

Other Important Ansible tools/components

Before installing Ansible, let’s explore other important tools, such as the Ansible Content Navigator (Ansible Navigator), execution environment, and Automation Content Collection.

Ansible Content Navigator

The Ansible content navigator, also known as the Ansible Navigator, is a tool used for developing, testing, and running Ansible playbooks. It replaces the “ansible-playbook” tool and other command line tools like “ansible config” and “ansible-inventory”. The Ansible Content Navigator separates the control node from the Automation execution environment by running playbooks in a container.

Ansible Automation execution environment

The Automation execution environment is a container image that includes Ansible/Ansible Core, Ansible Content Collections, Python libraries, executables, and other dependencies essential for playbook execution. With Ansible Navigator, you can choose a specific Automation execution environment for running your playbook.

In the next lesson, we will provide a step-by-step guide on how to install the Ansible software.

Thank you for reading, and please don’t forget to subscribe to our News letter, YouTube channel, like, share, and comment. Your engagement motivates us to create more valuable content. Goodbye for now

Ansible Content Collection

Ansible content collection

Like we understood above, the Ansible module is a crucial component, essentially a package or tool, serving as a unit of code to accomplish various IT tasks. In earlier Ansible versions, modules and their documentation/manual pages were bundled directly with the Ansible software. They were identified by short names like ‘dnf ‘, ‘copy,’ ‘file’, etc.

As Ansible became more popular and grew quickly, the number of included modules increased significantly. This posed difficulties, especially when users desired to use older or newer module versions than those bundled with a specific Ansible release. To address this, upstream developers made the strategic decision to organize the modules into distinct groups known as Ansible Content Collections.

Each Ansible Content Collection consists of related modules, roles, and plugins that collaborate seamlessly and receive support from the same group of developers. Ansible/Ansible core itself is limited to a small set of modules provided by the “ansible.builtin” Ansible content collection.

Starting from the Ansible/Ansible core version of 2.11, the modules are packaged in
sets in the “ansible.builtin” Ansible content collection and because there are other types of
Ansible content collection different from the “ansible.builtin“, it is recommended that
modules are named by their fully qualified collection names(FQCN). An example is “ansible.builtin.dnf“.

However, if you don’t name a module by its FQCN, Ansible still tries to resolve the short names but to avoid error it is a good practice to use the FCQN in a playbook. The Ansible core package inherently comes with the “ansible.builtin” content collection and these modules are always available for use.

With a subscription to Ansible Automation Platform 2, users gain access to over 120 certified content collections provided by Red Hat. Additionally, the Ansible galaxy hosts numerous community-supported collections that users can leverage.

In this subscription, the default automation execution environment utilized by Ansible Navigator, encompasses various Ansible Content Collections. To explore these collections, users can use the ‘ansible-navigator collections‘ command.

This underscores the close relationship between modules and Ansible Content Collections. Your understanding of this connection enhances your ability to leverage the full power of Ansible, and the Ansible automation platform architecture for streamlined automation.

Click To Watch Video On Ansible Automation Platform Architecture – Introduction To Ansible

RHCE/ex294 version 9 Exam Practice Questions

Step By Step Guide Of How To Install Ansible & Ansible Navigator On RHEL 9

In the previous lesson above, we explored the Ansible automation platform architecture, and the different ways to install Ansible. As I don’t have a subscription with Red Hat, the path I’m taking is installing it from the Red Hat Enterprise Linux 9 systems, where Ansible comes bundled with the ISO package. Let’s walk through the steps:

1. Local Repository Setup:

Configure a local repository using the RHEL 9 ISO. If you’re unsure how to do this, click here for the documentation link, and here for the Video link

2. Create a Non-Root User:

I prefer not to install Ansible as the root user. I will create a username, named Victor, and ensure that Victor is a sudo user by editing the sudoers file.

[root@ACN ~]# useradd victor
[root@ACN ~]# passwd victor
Changing password for user victor.
New password:
BAD PASSWORD: The password is shorter than 8 characters
Retype new password:
passwd: all authentication tokens updated successfully.

[root@ACN ~]# vi /etc/sudoers.d/victor
victor        ALL=(ALL)       NOPASSWD: ALL

3. Python Version Check:

Ansible requires Python 3.8 or higher. A quick check can be done using the command below.

[root@ACN ~]# python --version

Python 3.9.10

4. Install Ansible:

With the prerequisites in place, Ansible can be installed from the already configured local repositoty by using the command below. Switch to the user, victor before installing Ansible

[root@ACN ~]# ssh victor@localhost
victor@localhost's password:
Last login: Fri Nov 24 12:26:26 2023 from ::1
[victor@ACN ~]$
[victor@ACN ~]$  sudo dnf install ansible-core -y

Updating Subscription Management repositories....

[victor@ACN ~]$ ansible --version

ansible [core 2.12.2]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/victor/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /home/victor/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.9.10 (main, Feb  9 2022, 00:00:00) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)]
  jinja version = 2.11.3
  libyaml = True

5. Install Ansible Navigator:

Ansible Navigator is a crucial tool, and to install it, we need the PIP Python module. We need to install PIP Python module before we can install ansible-navigator.

[victor@ACN ~]$ sudo dnf install python3-pip -y

Updating Subscription Management repositories.....
[victor@ACN ~]$ python3 -m pip install ansible-navigator
[victor@ACN ~]$ ansible-navigator --version

ansible-navigator 3.5.0

6. Download Container Image:

To use Ansible Navigator effectively, we need to download the execution environment container image.

[victor@ACN ~]$ sudo dnf install podman -y

Updating Subscription Management repositories.....

If you have a container registry credentials, you can log in and pull the execution image but since we are using a local repository, We will leverage on the “ansible-navigator” command to download the necessary images.

[victor@ACN ~]$ ansible-navigator

The necessary images will be downloaded, and we can use the ESC key when the download is done.

We can also verify the downloaded execution image by using the commands below.

[victor@ACN ~]$ podman images
[victor@ACN ~]$ ansible-navigator images

And there you have it! Ansible and Ansible Navigator are now ready to rock on your system. Stay tuned for the next lesson in our Ansible adventure. Don’t forget to subscribe, like, share, and comment to keep the tech vibes flowing. Until next time, happy automating!

Thank you for reading, and please, don’t forget to subscribe, share, like, and comment. Your engagement motivates us to produce more insightful lessons. Goodbye for now!

Ansible automation platform architecture

Click here to watch Video On How To Install Ansible & Ansible Navigator On RHEL 9

Click here for ex294/RHCE version 9 exam practice questions on how to install Ansible & Ansible navigator on RHEL 9

Be the first to comment

Leave a Reply

Your email address will not be published.


*