This is a simple classroom server setup based on a real RHCSA exam server.
- NTP is configured
- HTTPD is configured
- NFS is configured
- Change the interface name in
./classroom/classroom/network/config.yml
file. - Change the hosts in
./classroom/classroom.yml
.
-
Create a new RHEL 9 machine with yum locally configured on it with network adapters.
-
Set hostname and domain name.
hostnamectl set-hostname classroom vim /etc/hosts # Add the following line: 172.25.250.254 content.example.com classroom
-
Install Ansible.
yum install ansible -y
-
Configure Ansible.
pwd /root mkdir ansible cd ansible vim ansible.cfg
Add the following content to
ansible.cfg
:[defaults] inventory = /root/ansible/inventory remote_user = root ask_pass = False roles_path = /root/ansible/roles/
vim inventory
Add the following content to
inventory
:[classroom] classroom
-
Create a role.
mkdir roles
-
Copy the
classroom.zip
file and extract.pwd /root ls unzip classroom.zip cp -rav classroom/classroom /root/ansible/roles/ cp classroom/classroom.yml /root/ansible/
-
Run the playbook
classroom.yml
.pwd /root/ansible ansible-playbook classroom.yml
Note: Make sure to adapt paths and commands based on your system configuration.