How dushyantkhobragade/linux-os-patching-using-ansible works
Project type and purpose
• This is a simple Ansible-based automation playbook for patching Fedora-based Linux hosts.
• Purpose: from a central “Ansible master” server, use SSH in an agentless fashion to update packages and reboot target machines in one or more inventory groups.
File structure
• Top-level files only:
• OS_Patching.yaml – the Ansible playbook defining tasks (e.g., yum update, reboot).
• ansible_inventory_file – hosts grouped by environment or role.
• README – usage instructions.
• No nested directories or multiple roles; everything is orchestrated in a single playbook.
Extract additional insights from README
• Inventory groups allow targeting specific machines.
• Execution is done as root on the master via:
ansible-playbook OS_Patching.yaml -i <Inventory_file>
• Warnings about experimental status highlight that this is a lean, point-in-time patch workflow.
a. Components
1. Ansible Master Server (control node)
2. Ansible Inventory File (defines host groups: e.g., web-servers, db-servers, staging)
3. OS_Patching.yaml Playbook (YAML file with tasks: package update, reboot)
4. SSH Protocol (agentless connection)
5. Target Fedora Linux Hosts (one or many)
6. Package Manager on hosts (dnf/yum)
b. Relationships & Data Flow
• The Master reads the Inventory to discover target hosts and group membership.
• The Playbook instructs the Master how to connect (via SSH) and which tasks to run.
• Over SSH the Master pushes modules and commands to each host’s Package Manager.
• Hosts execute updates, send back status, and optionally reboot.
c. Architectural Patterns & Principles
• Agentless orchestration (no persistent agent on hosts).
• Push-based configuration management.
• Idempotent tasks: running the playbook multiple times yields the same end state.
d. Key Technologies
• Ansible (control plane)
• YAML (playbook syntax)
• SSH (transport layer)
• DNF/YUM (package management)
• Fedora-based Linux (target OS)
Additional details to capture
• That the inventory groups can be logical (e.g., “prod”, “test”, “db”).
• Error handling or retry logic if desired (e.g., “––forks”, “––limit”).