Use the repo below to create VMs for this practice exam:
VirtualBox
Control node
Alternatively, run the following playbook from the control node:
Bash
1cd /rhce-practice-exam/rhce8/exam22ansible-playbook prepare-control.yml
Answers can also be found in the answers folder. I would advise to only use it as last resort.
The follow top-level objectives are covered on this exam.
Objectives covered:
Tasks:
/home/ansible/exam-files
. This is where all files will be saved
/home/ansible/exam-files/roles
/home/ansible/exam-files/inventory
/home/ansible/exam-files/scripts/check-connection.sh
that checks that the ssh connection works to all nodesObjectives covered:
Tasks:
Create the shell script /home/ansible/exam-files/scripts/get-server-info.sh
that:
Gets the hostname, OS name, OS version, tuned service status, and the tuned profile that is currently active. Output should look like:
1Hostname: control.ansi.example.com2Name: "Red Hat Enterprise Linux"3Version: "8.0 (Ootpa)"4Tuned status: active5Current active profile: virtual-guest
Create the ad-hoc script /home/ansible/exam-files/scripts/task2.sh
that:
/usr/local/bin/get-server-info.sh
Objectives covered:
Tasks:
Objectives covered:
Tasks:
/home/ansible/exam-files/playbooks/task4.yml
that:
/data/backup
on the 'webservers' group. The folder should have read and execute permission for group and others/etc/server_role
on all servers
rpm
command to check if 'httpd' is installed on the webservers and databases groups
rpm
task. These tasks should run against the same groups as the rpm
task:
Objectives covered:
Tasks:
/home/ansible/exam-files/files/root_space_check.sh
that gets the used space percent for root (/
) and:
root_space_check.sh[PID]: / usage is within threshold
when usage is below 70%root_space_check.sh[PID]: / usage is above 70% threshold
when usage is above 70%/home/ansible/exam-files/playbooks/task5.yml
that
root_space_check.sh
script to /usr/local/bin/
to all servers and set execute bit all accross (ugo)Listen
option in /etc/httpd/conf/httpd.conf
to the internal IP. E.g.: Listen 192.168.55.201:80
. Use facts variables for the internal IPhttpd.conf
is changed
httpd.conf
to /data/backup/httpd.conf-[YYYYMMDD_HHMMSS].zip
(change [YYYYMMDD_HHMMSS]
to a date string, e.g.: '20231123_2400')/data/databases
Objectives covered:
Tasks:
/home/ansible/exam-files/roles/start-page
1[HOSTNAME] - Should get the node FQDN value from an ansible fact variable2[VERSION] - Version group from the inventory3[IP ADDRESS] - Should get the node internal IP value from an ansible fact variable4[TIMEZONE] - Should
/home/ansible/exam-files/roles/journald-persistent
. This role should:
/home/ansible/exam-files/playbooks/task6.yml
that applies the 'start-page' role to the 'webservers' group and the 'jounald-persistent' role to all serversObjectives covered:
Tasks:
app_version
should be based on the version specified in the inventory file1"exam": {2 "server_info": {3 "group": "webservers",4 "app_version": "1"5 }6}
This task can be done via a playbook or manually
Objectives covered:
Tasks:
Before you start, remember you should have added a 10GB disk to node4 and increased it's memory to 1024M
/home/ansible/exam-files/roles/postgresql
that does the following:
/data/databases
@postgresql
Environment=PGDATA=
in the systemd service for 'postgresql.service' to have the value below (remember the old path and make sure new value is reloaded)Environment=PGDATA=/data/databases/postgresql_data
/data/databases/postgresql_data
/data/databases/postgresql_data
to postgres:postgres
with rwx------
postgresql-setup --initdb
selinuxuser_postgresql_connect_enabled
postgresql.service
postgresql.service
is changed/data/db_troubleshoot
/data/db_troubleshoot
to postgres:postgres
with rwx------
/data/db_troubleshoot
. This should also be the default ACL for new files/home/ansible/exam-files/playbooks/deploy-postgresql.yml
that pushes this role to the 'postgresql' groupThe postgresql service will fail to start. You will need to logon to the server and fix the issue. The solution/fix can be done manually, but it needs to be part of the playbook.
While creating the VDO device you may run into the error below:
fatal: [node4]: FAILED! => {
"changed": false,
"module_stderr": "Shared connection to node4 closed.\r\n",
"module_stdout": "/tmp/ansible_vdo_payload_crp07req/ansible_vdo_payload.zip/ansible/modules/system/vdo.py:330: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.\r\n/bin/sh: line 1: 6280 Killed /usr/libexec/platform-python /home/ansible/.ansible/tmp/ansible-tmp-1701096243.3300107-7102-276967642935618/AnsiballZ_vdo.py\r\n",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 137
}
If that's the case, fully remove the vdo device and then apply the patch below. While this is not part of the exam, it's a good skill to aquire.
https://github.com/ansible-collections/community.general/pull/5632/files
You can identify the path for the Ansible code with ansible --version
. Then browse to the module shown in that commit message and modify the 2x lines. Note that the line number may not match, but should be pretty close.
Objectives covered:
Tasks:
ansible-galaxy
search for and download the 'mysql' role by 'geerlingguy'ansible.cfg
/home/ansible/exam-files/vars/mysql.yml
and add the following variables:
~/.my.rc
/home/ansible/exam-files/playbooks/deploy-mysql.yml
that pushes the role to the mysql groupObjectives covered:
Tasks:
/home/ansible/exam-files/ansible.cfg.template
with a dump of all possible env and config values. For example:1ACTION_WARNINGS:2 default: true3 description: [By default Ansible will issue a warning when received from a task4 action (module or action plugin), These warnings can be silenced by adjusting5 this setting to False.]6 env:7 - {name: ANSIBLE_ACTION_WARNINGS}8 ini:9 - {key: action_warnings, section: defaults}10 name: Toggle action warnings11 type: boolean12 version_added: '2.5'
/home/ansible/exam-files/ansible.cfg.dump
with all the current variables/settings. For example:1ACTION_WARNINGS(default) = True2AGNOSTIC_BECOME_PROMPT(default) = True3ALLOW_WORLD_READABLE_TMPFILES(default) = False4ANSIBLE_CONNECTION_PATH(default) = None5ANSIBLE_COW_PATH(default) = None6ANSIBLE_COW_SELECTION(default) = default7ANSIBLE_COW_WHITELIST(default) = ['bud-frogs', 'bunny', 'cheese', 'daemon', 'default', 'dragon', 'elephant-in-snake', '>8ANSIBLE_FORCE_COLOR(default) = False9ANSIBLE_NOCOLOR(default) = False10ANSIBLE_NOCOWS(default) = False
/home/ansible/exam-files/ansible-modules.txt
with a list of all the Ansible modules available on this system. For example:1a10_server Manage A10 Networks AX/SoftAX/Thunder/vThunder device...2a10_server_axapi3 Manage A10 Networks AX/SoftAX/Thunder/vThunder device...3a10_service_group Manage A10 Networks AX/SoftAX/Thunder/vThunder device...4a10_virtual_server Manage A10 Networks AX/SoftAX/Thunder/vThunder device...5aci_aaa_user Manage AAA users (aaa:User)6aci_aaa_user_certificate Manage AAA user certificates (aaa:UserCert)7aci_access_port_block_to_access_port Manage port blocks of Fabric interface policy leaf pr...8aci_access_port_to_interface_policy_leaf_profile Manage Fabric interface policy leaf profile interface...9aci_access_sub_port_block_to_access_port Manage sub port blocks of Fabric interface policy lea...10aci_aep Manage attachable Access Entity Profile (AEP) objects...11aci_aep_to_domain Bind AEPs to Physical or Virtual Domains (infra:RsDom...12aci_ap Manage top level Application Profile (AP) objects (fv...13aci_bd Manage Bridge Domains (BD) objects (fv:BD)