
Set up a functional Ansible environment on AWS by configuring a control node on EC2, installing Ansible, adding Ubuntu managed hosts, enabling passwordless SSH, and testing with ad hoc commands.
Launch an AWS EC2 instance as an Ansible control node on Red Hat Enterprise Linux 9 and set up a 10 GB t2.micro with a new key pair for SSH.
Install ansible on the control node by ssh access with a private key and install the ansible core package from the AppStream repository on Red Hat Enterprise Linux 9.5.
Install and verify Ansible on the control node, launch two Ubuntu clients on AWS as managed nodes, log in via SSH, and update the systems.
Enable ssh communication by configuring sshd for password and public key authentication on both Ansible clients, edit the ssh config, generate ssh keys, and restart ssh as root.
Create a common user account across the Ansible control node and all clients (tech star / texstar) with a password. Configure /etc/hosts mappings and enable SSH password authentication for access.
Generate an RSA 2048 SSH key on the Ansible control node, copy the public key to Ansible clients to enable password-free access, and verify passwordless SSH.
Create a host inventory file on the Ansible control node, define the dev group with two clients, and list its hosts to verify connectivity.
Test the connection between the Ansible control node and the dev group using the ad hoc command with the ping module, confirming reachability and readiness for further commands.
Practice Ansible ad hoc commands using the command module on the dev group to fetch uptime and IP addresses, while firewall status requires root access.
Update the sudoers file to let the techstart user execute commands as root without a password, and verify ufw status shows inactive on both managed nodes.
Learn to manage Ansible inventory with static inventories, nested groups, and ranges. Explore dynamic inventory, verify setup, and use Ansible Navigator to run and compare to the traditional playbook command.
Learn how ansible inventory defines the servers to manage and connect. Use simple files or dynamic sources to group hosts such as web and database in ini or yaml.
Compare static inventories, a fixed host list defined in an inventory file with groups, to dynamic inventories generated by cloud providers; use -i to specify a custom inventory.
Add host entries to the inventory file, organizing servers into prod, dev, test, and web server groups. List all servers with the command ansible --list-hosts all to verify the inventory.
Edit the ansible inventory to add server nine under the dv group, use a custom ssh port 12345, and set ansible_user to sam for that server.
Define multiple hosts efficiently in an Ansible inventory using range syntax for IP addresses and hostnames, create server IP and server name groups, and verify with ansible --list-hosts.
Explore Ansible navigator, a command line interface with a text user interface that runs playbooks, browses inventories, and reviews logs on the Red Hat Ansible automation platform for RHEL 9.
Explore Ansible Navigator modes by running playbooks, examining inventories, viewing collections, and accessing module documentation.
Compare ansible-navigator with ansible-playbook, highlighting a modern CLI with a text-based UI, container-based execution, and a structured view of tasks, logs, and inventory.
Install and configure ansible-navigator, and launch its interactive text user interface to load playbooks and inventories. Pull the required container image with Podman and explore the CLI menu options.
Learn to use Ansible Navigator to view inventory content, specify inventory location, and display options in stdout mode, including listing servers, graphing groups, and checking hosts.
View the Ansible inventory in a text user interface with Ansible Navigator, select inventory, browse groups and hosts, and inspect servers by group.
Configure Ansible behavior by creating and editing two project files - ansible.cfg and ansible-navigator.yml - and learn how to identify the active configuration with ansible --version.
Create a user-specific Ansible configuration with a hidden .ansible.cfg in your home directory to override the global config, customize inventory, and adjust host_key_checking and retry_files_enabled.
Configure per-user inventory paths in the Ansible config, create and place inventory files, and verify groups like dev and all with Ansible --list-hosts.
Configure Ansible navigator with the ansible-navigator.yml file to set a default inventory location and disable the execution environment, enabling direct local execution of Ansible commands.
Explore two execution methods with Ansible Navigator: run your playbook in a lightweight container or directly on the host, then ping dev-group clients to test connectivity.
Participate in a scenario-based hands-on lab to validate connectivity from the Ansible server to dev-group hosts using Ansible Navigator, comparing containerized and non-containerized execution with a ping playbook.
Demonstrate running a playbook with ansible navigator inside a temporary container when execution environment is enabled, using a dev inventory and two clients to validate connectivity.
This hands-on lab shows disabling the execution environment for Ansible navigator, resulting in no container and reliance on local Python libraries.
Use ansible navigator's text user interface to run a playbook and validate the output. Then browse inventory and hosts, switch between ansible clients, and inspect dev group for two hosts.
Learn how Ansible playbooks automate tasks across servers, mastering structure, hosts, tasks, variables, and modules. Practice writing, validating syntax, and executing playbooks via the CLI or Ansible Dash.
An ansible playbook is a plain text yaml file that defines a series of tasks to run on remote hosts using ansible modules, enabling automation with one command.
Learn how to write an Ansible playbook with YAML syntax, define hosts, elevate privileges with become, and use the user module to ensure DevOps exists idempotently.
Practice lab demonstrates creating an Ansible playbook to ensure a DevOps user exists on the managed host using the built-in user module, with Ansible Navigator, syntax check, and removal steps.
Execute a playbook with Ansible Navigator, using the host's inbuilt modules, specifying inventory and playbook paths, and verify user account creation on multiple clients.
Execute an Ansible navigator lab with the execution environment enabled and run the playbook to create the devops user on both client servers using the inventory file.
This lab teaches building an Ansible playbook to create /opt/scripts with 077 permissions using the file module, verify syntax, and run it with Ansible Navigator while addressing remote_user authentication.
Define and manage Ansible variables and facts to configure hosts, capture command output, and override values from the command line. Use dictionaries to keep playbooks reusable and scalable across servers.
Learn how Ansible variables store values (strings, numbers, lists, dictionaries) in YAML, enabling playbooks across inventory, host or group vars, and command line extra vars via double curly brackets.
Define valid Ansible variable names by starting with a letter and using letters, numbers, and underscores; case sensitive; avoid spaces, hyphens, at signs, and dots; prefer underscores to separate words.
Define group variables in an Ansible inventory by adding a vars section under the web servers group and apply a, b, and http_port to all hosts.
Define group variables by creating a group_vars directory with a YAML file named after the group, enabling variables like http_port and doc_root for the prod group.
Define variables in Ansible playbooks using vars or vars_files for play-wide configuration. Use set_fact to create task-specific variables that apply only within a single task and illustrate with lab examples.
Learn how to define and use dictionaries as variables in Ansible. Structure related data as key-value pairs under a single variable such as user_info, and access values with dot notation.
Define a user_info dictionary with name, uid, and shell in an Ansible playbook, then access values via dot notation and run it with Ansible navigator.
Learn to capture command output in Ansible by using the register keyword to store results in a variable, then access the text via the variable’s stdout for later tasks.
Capture the output of a command with a registered variable, print disk space results with debug, and demonstrate registering install results during Apache installation.
Learn to manage secrets in Ansible with Ansible Vault, encrypting passwords, API keys, and private keys (files or variables), and decrypting when needed to run encrypted playbooks.
Learn to manage secrets in Ansible by creating encrypted playbooks with Ansible Vault, write a simple debug playbook, and securely view encrypted content with the vault view command.
Manage secrets in Ansible by encrypting files with vault using a password file. Create encrypted yml with vault create and view it with vault view using the same password file.
Learn to edit and view encrypted files with Ansible Vault by supplying a password, and encrypt plain text files using the ansible-vault encrypt command.
Securely create a Linux user with a hashed password using an Ansible playbook, encrypt the playbook with Ansible Vault, and run it via Ansible Navigator to verify the user.
Create an Ansible playbook to securely add a user on managed hosts using the built-in user module and a hashed password, then encrypt with Ansible vault.
Demonstrates secure user creation with an Ansible Navigator run of the pr.yml playbook, using Ansible Vault vault-id prompts to decrypt content, disable artifact file, and specify inventory and username.
Master Ansible task control by using loops and conditionals to automate repetitive tasks, iterate over items and dictionaries, and use registered variables to drive conditional execution on Ubuntu systems.
Use loops for task iteration in Ansible, repeating a task for multiple items with the loop keyword to install packages or create users, keeping playbooks clean and efficient.
Learn to implement loops in an Ansible playbook to install multiple packages on remote dev servers, using a single task with a packages module to manage nginx, git, and curl.
Execute a lab playbook that demonstrates looping over variable lists to install mail packages with Ansible Navigator. Verify installations on multiple clients using dpkg checks.
Learn how to loop over a list of dictionaries in Ansible to create users and assign them to groups, using a users variable with name and group keys.
Loop through a list of dictionaries to create Linux users with Ansible, defining user_list and ensuring groups exist, users are created, and actions are idempotent.
Execute a playbook with Ansible Navigator to create users Alice, Bob, and Charlie in admin, dev, and QA groups, confirming groups exist and memberships.
Explore earlier-style loop keywords in Ansible, such as with_items, with_dict, and with_file, showing how they iterate over lists, dictionaries, and files before the modern loop syntax.
Learn how to use register with loop in Ansible to create multiple temporary files, capture each result in a variable, and display outcomes with debug messages.
Demonstrates running an Ansible playbook with Ansible Navigator to create three files using register with loops, showing task logs and each file creation in real time.
Welcome to RedHat Automation with Ansible – RHEL 9 (RH294).
If you’re a system administrator, DevOps engineer, or just someone who wants to automate Linux-based tasks, this course is your complete guide to learning Ansible — one of the most powerful tools in IT automation.
Here’s what you’ll learn:
Ansible Setup in AWS Environment
Getting Started with This Section
Set Up an EC2 Instance as an Ansible Control Node
Install Ansible on Control Node
Set Up Two Client Machines as Managed Nodes
Enable SSH communication
Add Same User to All Machines
Generate SSH Key for Password-Free Access
Create Host Group in Inventory File
Test Connection Using Ad-Hoc Commands
Guided Exercise - 1
Guided Exercise - 2
Mastering Ansible Inventory and ansible-navigator: A Step-by-Step guide
Getting Started with This Section
Understanding Ansible Inventory
Static vs Dynamic Inventory in Ansible
How to Add Host Entries in Inventory
Adding Hosts with Custom Ports and Users
Using Host Ranges in Ansible Inventory
Getting Started with Ansible Navigator: Installation, Modes, and Usage
Ansible Navigator: Quick Overview
Navigator Modes Explained: Run, Inventory, Collections & More
ansible-navigator vs ansible-playbook: Key Differences
Installing ansible-navigator
Setting Up ansible-navigator
View Inventory with ansible-navigator (stdout mode)
Explore Inventory in TUI Mode Using ansible-navigator
Managing Ansible Configuration Files
Configuring Ansible Basics
Setting Up User-Specific Ansible Configuration
Defining Inventory File Path in Ansible Config
Working with ansible-navigator Configuration File
Ansible Navigator - Scenario Based Guided Lab
Getting Started with this Section
Hands-On Lab 1
Hands-On Lab 2
Hands-On Lab 3
Hands-On Lab 4
Implementing an Ansible Playbook
Getting Started with this Section
What is an Ansible Playbook
Ansible Playbook Syntax and Formatting
Lab Exercise: Creating Your First Ansible Playbook
Lab Exercise: Run Playbook Using Ansible Navigator
Lab Exercise: Ansible Navigator with EE Enabled
Lab Exercise: Directory Creation Using Playbook
Ansible Variable and Facts
Getting Started with this Section
Introduction to Ansible Variables
Valid and Invalid Variable Names
Defining Group Variables in Ansible Inventory
Defining Group Variables via group_vars
Defining Host Variables
Defining Variables in Ansible Playbooks
Overriding Variables with ansible playbook
Overriding Variables with ansible-navigator
Use Dictionaries as Variables in Ansible
Hands-On: Use Dictionaries
Capturing Output with Registered Variables
Hands-On: Capturing Output with register
Managing Secrets in Ansible
Introduction to Ansible Vault and Secret Storage
Ansible Vault: File Encryption
Ansible Vault: Using Password Files for Encryption
Ansible Vault: Modify Encrypted Files
Hands-On 1: Secure User Creation with Ansible Vault
Hands-On 2: Secure User Creation with Ansible Vault
Hands-On 3: Secure User Creation with Ansible Vault
Hands-On 4: Secure User Creation with Ansible Vault
Hands-On 5: Secure User Creation with Ansible Vault
Task Control Implementation in Ansible
Getting Started with this Section
Task Iteration with Loops in Ansible
Hands-On: Installing Multiple Packages Using Loops
Loop with a Variable List
Hands-On: Iterating Variable Lists with Loops
Ansible Loops with List of Dictionaries
Hands-On 1: Looping Through Dictionary Lists
Hands-On 2: Looping Through Dictionary Lists
Earlier-style Loop Keywords: with_items, with_dict etc
Hands-On 1: Register with Loop in Ansible
Hands-On 2: Register with Loop in Ansible
Implementing Conditional Task Control
Running Tasks Conditionally
Hands-On: Install Apache Only if RAM > 2GB
Hands-On: Run Task Only if OS is Debian
Hands-On: Run Task When web_enabled is True
Hands-On: Run Task if RAM > 2GB AND OS is CentOS
Hands-On: Run Task if OS is Ubuntu OR Debian
Deploying Files to Managed Hosts
Describing File Modules
Hands-On: Create a Directory
Hands-On: Copy a File to Remote
Hands-On: Fetch File From Remote to Local
Hands-On: Insert Line Using lineinfile Module
Hands-On: Insert Config Block Using blockinfile Module
Deploying Custom files with Jinja2 Templates
Introduction to Jinja Templating in Ansible
Control Structures with Loops and Variables
Hands-On: Control Structures
Using Ansible Facts in Jinja2 Templates
Guided Exercise - 1
Guided Exercise - 2
Guided Exercise - 3
Managing Complex Plays and Playbooks
Selecting Hosts with Host Patterns
Hands-On: Defining Ansible Host Patterns
Hands-On: Defining Ansible Host Patterns
Including and Importing Files
Include vs Import in Ansible
Import_playbook in Ansible
Hands-On 1: Include and Import Files – Apache Setup
Hands-On 2: Include and Import Files – Apache Setup
Hands-On 3: Include and Import Files – Apache Setup
Guided Exercise: Apache Web Server Automation
Overview of the Project
Hands-On Practice 1
Hands-On Practice 2
Modular Playbook Design with Roles and Collections
Describing Role Structure
Hands-On Project: Automate Server Hardening
Hands-On: Roles for User and Timezone Setup
Hands-On: Role for Firewall Custom Port Access
Hands-On: Role for SSH Configuration
Hands-On: Use Roles in a Playbook
Hands-On: Execute the Playbook
Hands-On: Verify Changes on Client Node
Using External Ansible Roles from Ansible Galaxy
Overview: Using External Roles from Galaxy
Hands-On: Install External Role geerlingguy.nginx
Hands-On: Create a Playbook with External Role
Hands-On: Run Playbook with ansible-playbook
Hands-On: Run Playbook with ansible-navigator
Troubleshooting in Ansible: Debugging and Error Handling
Analyzing Ansible Log Files
Using the debug Module for Troubleshooting
Handling Errors Gracefully in Ansible
Debugging Techniques in Ansible
Using check_mode to Test Playbook Execution
Last Lecture