Red Hat Certified Specialist in Ansible Automation exam – explained in detail

Over the last few years, Ansible has rapidly become one of the most popular IT automation tools in the world. We’ve seen the open source community expand from the launch of the project in 2012 to over 1200 individual contributors nowadays. This article describes the Red Hat Certified Specialist in Ansible Automation exam; it also provides helpful tips that could aid during the exam preparation process.

Who is supposed to take it?

Red Hat Certified Specialist in Ansible Automation exam is for you if any of the below bullet points identifies you:

  • You are a system administrator who manages a large number of servers. 
  • You work in a DevOps environment and want to automate everyday tasks and routines. 
  • You are a developer who needs to automate into your application development lifecycle.
  • You are interested in becoming a Red Hat Certified Architect.

What are the subjects covered?

As a candidate for the Red Hat Certified Specialist in Ansible Automation title, you are expected to understand the following concepts:

  • Core components of Ansible that includes: inventories, modules, variables. Facts, plays, playbooks, configuration files.
  • Installation of Ansible control node and Ansible managed nodes.
  • Ad-hoc Ansible commands.
  • Plays and playbooks.
  • Ansible modules for managing software packages, services, firewall rules, file systems, storage devices, file content, archiving, scheduled tasks, security, users, and groups.
  • Creating Ansible templates.
  • Managing roles.
  • Using ansible vault to protect sensitive data.

You can visit the official website where Red Hat published study points in detail:
https://www.redhat.com/en/services/training/ex407-red-hat-certified-specialist-in-ansible-automation-exam

How do you prepare for it?

The Red Hat Certified Specialist in Ansible Automation, like any other Red Hat exam is a performance-based exam. During the test, you will receive an SHH access to a test environment and a set of tasks that you should complete. Therefore the best way to prepare for the exam is to practice. Based on the exam curriculum, I have created a list of tasks that will help understand major Ansible concepts and significantly increase your success odds. The list is shown below:

Part 1. Configure Ansible environment:

Tasks:

  1. On your control node, install necessary Ansible packages.
  2. Create a static host inventory file that contains two groups: webservers and dbservers.
  3. Configure Ansible to use the inventory file you created as a default inventory file.
  4. On both control node and managed nodes, configure Ansible user with the ability for password less privilege escalation.
  5. To Generate and distribute ssh-keys so control Ansible user on a control node can connect via ssh to worker nodes without a password.
  6. Set the default number of forks to 3.

Documentation:
https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html
https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html
https://docs.ansible.com/ansible/latest/reference_appendices/config.html
https://docs.ansible.com/ansible/latest/user_guide/intro_getting_started.html

Part 2. Use ad-hoc Ansible commands.

Tasks:

  1. Ping a node using ad-hoc Ansible commands.
  2. Install a package using ad-hoc Ansible commands.
  3. Create a file using ad-hoc Ansible commands.
  4. Change file properties using ad-hoc Ansible commands.
  5. Copy a file from a control node to a worker node using ad-hoc Ansible commands.
  6. Create a Linux user using ad-hoc Ansible commands.
  7. Create a Linux group. Add a Linux user using ad-hoc Ansible commands.
  8. Create a firewall rule that allows all traffic using ad-hoc Ansible commands.
  9. Create a firewall rule that allows only port 22 using ad-hoc Ansible commands.
  10. Enable a Linux service using ad-hoc Ansible commands.
  11. Disable a Linux service using ad-hoc Ansible commands.
  12. Restart a Linux service using ad-hoc Ansible commands.
  13. Mount a drive, create a file system using ad-hoc Ansible commands.
  14. Create an archive using ad-hoc Ansible commands.
  15. Extract an archive using ad-hoc Ansible commands.
  16. Append a line into a file of your choice using ad-hoc Ansible commands.
  17. Create an LVM volume using ad-hoc Ansible commands.

Documentation:
https://docs.ansible.com/ansible/latest/user_guide/intro_adhoc.html
https://docs.ansible.com/ansible/latest/modules/ping_module.html
https://docs.ansible.com/ansible/latest/modules/yum_module.html
https://docs.ansible.com/ansible/latest/modules/file_module.html
https://docs.ansible.com/ansible/latest/modules/copy_module.html
https://docs.ansible.com/ansible/latest/modules/group_module.html
https://docs.ansible.com/ansible/latest/modules/firewalld_module.html
https://docs.ansible.com/ansible/latest/modules/service_module.html
https://docs.ansible.com/ansible/latest/modules/mount_module.html
https://docs.ansible.com/ansible/latest/modules/filesystem_module.html
https://docs.ansible.com/ansible/latest/modules/archive_module.html
https://docs.ansible.com/ansible/latest/modules/unarchive_module.html
https://docs.ansible.com/ansible/latest/modules/lineinfile_module.html
https://docs.ansible.com/ansible/latest/modules/lvol_module.html

Part 3. Playbooks

Tasks:

Create a set of simple Ansible playbooks that perform the same tasks that are mentioned in step 2.

Documentation:
https://docs.ansible.com/ansible/latest/user_guide/playbooks.html

Part 4. Use different Ansible structures to control play execution

Tasks:

  1. Run an arbitrary command and register its output as a variable. Print this variable.
  2. Create several users on managed nodes using loops.
  3. Create a playbook that installs apache on the webservers group, uploads index.html, and restarts apache only when index.html is changed.
  4. Create one more playbook that appends the arbitrary line to index.html in case hostname is equal to tiger.domain.com (replace tiger.domain.com with hostname of one of your managed nodes).
  5. Create a playbook downloading index.html via URL from all nodes and ignores nodes that do not have index.html.
  6. Create a playbook that downloads index.html via URL from all nodes and prints a custom error message if index.html does not exist on a node.
  7. Create a playbook that uploads blue.txt to all nodes when the blue option is specified in the tags, and uploads green.txt to all nodes when the green option is specified in the tags.
  8. Create a playbook that overrides a default number of forks with 10.
  9. Create a playbook that is applied to only 1 host at first and to the rest of the servers after in the 10% increment.
  10. Create a playbook that will stop running in case of having errors on more than 30% of hosts.
  11. Create a playbook that creates a file with the host’s IP address on each host.
  12. Create a playbook that accepts a path to a file as a variable and writes a list of IP addresses to that file.
  13. Create a playbook that pastes a VAR into a file using J2 template.
  14. Create a custom fact.

Documentation:
https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html
https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html
https://docs.ansible.com/ansible/latest/user_guide/playbooks_conditionals.html
https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variables-discovered-from-systems-facts
https://docs.ansible.com/ansible/latest/modules/uri_module.html
https://docs.ansible.com/ansible/latest/modules/get_url_module.html
https://docs.ansible.com/ansible/latest/user_guide/playbooks_blocks.html
https://docs.ansible.com/ansible/latest/user_guide/playbooks_strategies.html
https://docs.ansible.com/ansible/latest/user_guide/playbooks_error_handling.html
https://docs.ansible.com/ansible/latest/user_guide/playbooks_delegation.html
https://docs.ansible.com/ansible/latest/user_guide/playbooks_tags.html
https://docs.ansible.com/ansible/latest/modules/template_module.html

Part 5. Ansible roles

Tasks:

  1. Create an Ansible role that installs Apache HTTPD server and distributes templated configuration files to each managed node.
  2. Create an Ansible role that installs PHP and uses the apache role created during the previous step as a dependency.
  3. Install Elasticsearch using a role from the Ansible galaxy

Documentation:

https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html
https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html#ansible-galaxy

Part 6. Ansible vault

Tasks:

  1. Create a text file, encrypt it using Ansible-vault, and then Edit the encrypted file.
  2. Create a playbook that writes an encrypted message to a file on all nodes.
  3. Execute particular play based on tags.

Documentation:
https://docs.ansible.com/ansible/latest/user_guide/vault.html

Additional resources

In addition to the exam curriculum and the Ansible documentation, I used several other resources throughout my exam journey. They repeat each other Almost always, therefore studying all of them is not required to succeed; this includes:

Finale

It does not matter whether you are a SysAdmin, a DevOps engineer, or a Developer – Ansible is an exceptional tool that can solve numerous problems and help you get over a variety of obstacles. The Red Hat Certified Specialist in Ansible Automation is a significant addition to your resume. I wish you good luck during the exam. If you have any comments or suggestions, please feel free to contact me directly.

Leave a Reply

%d bloggers like this: