RHCE Part 2: Automating RHCSA Tasks with Ansible
RHCE Part 2: Automating RHCSA Tasks with Ansible: a advanced Rhce course preparing for RHCE with 24 hours of lessons and hands-on labs. Modules: Software packages and repositories, Services, Firewall rules, Storage devices and file systems, File content, Archiving, Task scheduling, Security (SELinux), Users and groups.
Modules
- Software packages and repositories
- Services
- Firewall rules
- Storage devices and file systems
- File content
- Archiving
- Task scheduling
- Security (SELinux)
- Users and groups
Labs
- Automate Packages and Repositories — WebAsha's inventory is ready in `~/ansible` (dev: node1, test: node2, prod: node3 + node4, webservers = prod). From now on nobody logs in to the nodes: every change is a playbook run from control. Start by installing the collections you need, then set up repositories and packages per environment.
- Automate Services with systemd — Production web traffic must be served by node3 and node4 only. Someone started Apache on the dev box by hand and the test box runs an `atd` nobody needs. Fix all of it with playbooks and add a small WebAsha heartbeat service on dev.
- Automate firewalld Rules — Security wants every firewall change scripted and persistent. `ansible.posix` is already installed in `~/ansible/collections`. Each rule must be active now **and** survive a reload/reboot.
- Automate Partitions, LVM and File Systems — The `storage` group holds node1 (dev), node2 (test) and node3 (prod). node2 has an empty 2 GiB disk `/dev/vdb`; node3's disk already carries the volume group `research`; node1 has no spare disk at all. Exam-style: one playbook must cope with all three. Collections are installed in `~/ansible/collections`.
- Automate File Content: copy, template, lineinfile, blockinfile — WebAsha standardises login banners, SSH settings and shared directories across environments. Every file must be managed by a playbook so the next run puts it back if someone edits it by hand.
- Automate Archives: archive, unarchive and fetch — Before a web upgrade WebAsha wants the Apache configuration of both production servers backed up and copied to control, the new site unpacked on the web servers, and old application logs on test rolled into a compressed archive. `community.general` is installed in `~/ansible/collections`; the new site is in `~/ansible/files/site.tar.gz`.
- Automate cron and at Jobs — WebAsha moves its scheduled jobs into Ansible: a heartbeat for the devops account, a weekday backup on production, a boot marker and a one-off disk report on test, and an old job on node4 that must go. `ansible.posix` is installed in `~/ansible/collections`.
- Automate SELinux Settings — Production must serve the content in `/web` on port 82 with SELinux enforcing. Someone left every node permissive in `/etc/selinux/config`. `ansible.posix` and `community.general` are installed in `~/ansible/collections`. Use the SELinux modules, as on the exam: `community.general.sefcontext`, `ansible.posix.seboolean` and `community.general.seport` (the nodes run the WebAsha SELinux simulator, which these modules use like the real thing).
- Automate Users, Groups, Vault Passwords and sudo — HR sent `~/ansible/user_list.yml` (developers and managers). Developers get accounts on dev and test, managers on prod, all with passwords kept in an Ansible Vault file. Anika's public key is in `~/ansible/files/anika.pub`. Managers need sudo, and the old `olduser` account must disappear everywhere.
- Review: Automate RHCSA Tasks (timed) — Exam rehearsal, 60 minutes, playbooks only. Inventory: dev = node1, test = node2, prod = node3 + node4, webservers = prod. Nothing is installed in `~/ansible/collections` yet. node4 already has a 1 GiB volume group `apps`; the other nodes have no `apps` VG.
FAQ
How long is RHCE Part 2: Automating RHCSA Tasks with Ansible?
About 24 hours of guided lessons plus hands-on labs, at your own pace.
Do I need my own lab setup?
No. Every lab runs in your browser on a real machine provided by AI WebAsha.
Does it prepare for RHCE?
Yes. The modules and labs follow the RHCE objectives and include mock exam practice.