# dushyantkhobragade/linux-os-patching-using-ansible architecture

> Architecture diagram of the GitHub repository dushyantkhobragade/linux-os-patching-using-ansible, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dushyantkhobragade/linux-os-patching-using-ansible
- Repository: https://github.com/dushyantkhobragade/linux-os-patching-using-ansible

## Overview

##### 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”).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Subgraphs
    subgraph "Control Plane"
        direction TB
        Master("Ansible Master Server"):::control
        Playbook["OS_Patching.yaml"]:::control
        Inventory["ansible_inventory_file"]:::control
        README["README"]:::control
    end

    subgraph "Transport Layer"
        direction TB
        SSH("SSH Protocol"):::transport
    end

    subgraph "Data Plane"
        direction TB
        Host("Fedora Linux Host"):::data
        PM("Package Manager (DNF/YUM)"):::data
    end

    %% Connections
    Master -->|"reads inventory"| Inventory
    Master -->|"reads playbook"| Playbook
    Master -->|"interprets tasks"| Playbook
    Master -->|"pushes modules"| SSH
    SSH -->|"agentless connection"| Host
    Host -->|"executes updates on"| PM
    Host -->|"callback JSON status"| Master

    %% Click Events
    click Playbook "https://github.com/dushyantkhobragade/linux-os-patching-using-ansible/blob/main/OS_Patching.yaml"
    click Inventory "https://github.com/dushyantkhobragade/linux-os-patching-using-ansible/tree/main/ansible_inventory_file"
    click README "https://github.com/dushyantkhobragade/linux-os-patching-using-ansible/tree/main/README"

    %% Styles
    classDef control fill:#cce5ff,stroke:#005cbf,color:#005cbf,stroke-width:2px;
    classDef transport fill:#ffe5b4,stroke:#ff8c00,color:#ff8c00,stroke-width:2px;
    classDef data fill:#d4edda,stroke:#28a745,color:#28a745,stroke-width:2px;
```
