Red Hat Certified Engineer (RHCE)
Ansible Automation 9
PenguinNuggets by Dr. Yousif
Red Hat Certified Engineer (RHCE)
Ansible Automation 9
PenguinNuggets by Dr. Yousif
Use vmWare Workstation to create 3 RHEL 9 servers:
control.example.local (Server with GUI)
ansible1.example.local (minimal install)
ansible2.example.local (minimal install)
The latest version of RHEL can be obtained for free from the Red Hat Developers web site
The machines require Internet access
GitHub--Classroom Files: https://github.com/professoryousif/ansible
1) Download the the vimrc file from the GitHub Repository.
2) Login with the root account, and save the vimrc in the /etc directory
3) Copy and past this script in your terminal:
git clone https://github.com/Yggdroot/indentLine.git ~/.vim/pack/vendor/start/indentLine
vim -u NONE -c "helptags ~/.vim/pack/vendor/start/indentLine/doc" -c "q"
4) Test your VIM config, using any of the .yml files in the github repository at https://github.com/professoryousif/ansible
TMUX Terminal Multiplexer
To create a horizontal split, press Ctrl+B followed by " (that's a double-quote).
Using YAML code to write an Asible playbook with multiple plays and then implementing the playbook using the ansible-navigator command (Ansible runnning withing a container image --AKA Execution Environment)
You can download the internet.yml file from the my GitHub repository
Managing Variables and Secrets: storing variables in lists; storing secrets in vaults; storing module results in registers; implementing variables, registers, and secrets in a playbook; troubleshooting playbook errors.
Playbook files are downloadable from the GitHub Repository : https://github.com/professoryousif/ansible
Files include: user.yml, dbservers.yml, and secret.yml (valut password for secret.yml is redhat)
Managing Ansible Facts: Facts as Paython, nested dictionaries collected by the ansible.builtin.setup module. Using facts in playbooks. Using facts in Jina templates.
Playbook files are downloadable from the GitHub Repository : https://github.com/professoryousif/ansible
Implementing Task Control using Loops: This is a lecture comparing simple loops using Python Lists with simple items Vs. Using lists with dictionaries and key-value pairs nested under each dictionary item in a list.
Implementing Task Control Using Conditionals: Understanding the idempotent nature of Ansible tasks; Understanding the Notify-Handlers structure
Rules to remember: Handlers run in the order specified by the handlers section of the play and NOT in the order in which they are listed by notify statements | Handlers run after all the tasks under the tasks section of a play have been processed | If a task that includes notify doesn't report a change, the handler doesn't run. (hence conditional 🤓)
Handling Task Failure: (Lecture)
ignore_errors: yes | force_handlers: yes | changed_when: false | changed_when |
block: rescue: always:
Implementing Task Control-Comprehensive Lab (Demo)
Playbook files are downloadable from my GitHub Repository: https://github.com/professoryousif/ansible
Download control.yml and dbservers.yml.
Modifying and Copying Files to Managed Hosts: The following modules form the builtin collection are used in this playbook: fetch, copy, lineinfile, blockinfile, debug, command, and pause modules.
You can download the depl_files.yml from my GitHub Repository: https://github.com/professoryousif/ansible
Deploying files-Comprehensive Lab: The following modules from the builtin collection are included in this demo: template, stat, file, and debug modules.
Including and Importing Files: Creating sub-directories for tasks and plays :: Parameterize task files with variables :: Import task files when using loops. Download the lab files from my GitHub Repository at : https://github.com/professoryousif/ansible
Creating a Complex Playbook-Comprehensive Example. Download the lab files (xplaybook.yml, plays and tasks sub-directories) from my GitHub Repository at : https://github.com/professoryousif/ansible
Getting Roles and Modules from Content Collections :: Ansible Galaxy :: Community Content Collections
Reusing Content with System Roles :: Red Hat Automation Hub
Managing Storage :: using the redhat.rhel_system_roles.storage to mange logical volumes on remote hosts
Managing Networking :: using the redhat.rhel_system_roles.network to mange network configurations on remote hosts