This Ansible playbook performs basic system setup on Red Hat Enterprise Linux (RHEL) servers. It includes:
- Installing security updates for the kernel (for web servers only)
- Creating a user named
padawan
- Installing and configuring Apache (
httpd
) for web servers - Ensuring
firewalld
is installed, running, and configured to allow HTTP traffic
- Ansible installed on the control node
- Inventory defining groups such as
[web]
- Target systems running RHEL-based distributions
- Ensure you have an inventory file (
inventory.ini
) with a[web]
group, e.g.:[web] node1 ansible_host=192.168.1.100 ansible_user=root
- Run the playbook with:
ansible-playbook -i inventory.ini system_setup.yml
ansible.builtin.dnf
: Installs packages (httpd
,firewalld
, kernel updates)ansible.builtin.user
: Creates a system useransible.builtin.service
: Manages systemd servicesansible.posix.firewalld
: Configures firewall rules