Ansible EX294 Task List

1. Create YUM Repository Playbook (yum.yml)
i) Repository 1 - EX294_BASE - Description: EX294 base software - Base URL: http://content/rhel9.0/x86_64/dvd/BaseOS - GPG signature enabled - GPG key: http://content.example.com/rhel9.0/x86_64/dvd/RPM-GPG-KEY-redhat-release ii) Repository 2 - EX294_STREAM - Description: EX294 stream software - Base URL: http://content/rhel9.0/x86_64/dvd/AppStream - GPG signature enabled - GPG key: http://content.example.com/rhel9.0/x86_64/dvd/RPM-GPG-KEY-redhat-release
2. Install Packages (packages.yml)
- Install php & mariadb on hosts: dev, test, prod - Install RPM Development Tools on dev group - Update all packages to latest version on dev
3. Ansible Content Collections
- dnf install rhel-system-roles -y - Install ansible-posix-2.0.0.tar.gz from: http://172.25.250.14/collection/ - Install system roles from: http://content/Rhce/redhat-rhel_system_roles-1.0.0.tar.gz
4. Use a RHEL System Role (timesync.yml)
- Runs on all managed nodes - Use timesync role - Use currently active NTP provider - Time server: 172.25.254.254 or Classroom.example.com - Enable iburst parameter
5. Install Roles using Ansible Galaxy
- Use requirements.yml to install: i) balancer role from http://content.example.com/rhce/balancer.tgz ii) phpinfo role from http://content.example.com/rhce/phpinfo.tgz
6. Create and Use a Role (apache)
- Role path: /home/admin/ansible/roles/apache - Install httpd, enable and start - Allow firewall access to web server - Use index.html.j2 template - Template content: Welcome to HOSTNAME on IPADDRESS - Playbook: /home/admin/ansible/newrole.yml - Run on webservers group
7. Generate Hosts File
- Download template from: http://172.25.250.14/hosts.j2 - Use template to generate /etc/myhosts on dev group - Format like /etc/hosts: 127.0.0.1 localhost localhost.localdomain localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6.localdomain6 172.25.250.13 serverd.lab.example.com serverd
8. Create a Cron Job (crontab.yml)
- User: natasha - Command: logger "EX294 in progress" - Schedule: Every 2 minutes - Verify: crontab -u natasha -l