# devopsboy/ansible architecture

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

- Interactive diagram: https://gitdiagram.com/devopsboy/ansible
- Repository: https://github.com/devopsboy/ansible

## Overview

##### Project type and purpose
- This is an Ansible “infrastructure-as-code” project whose sole deliverable is a basic playbook (`ansible-playbook-basic.yaml`) accompanied by a README.
- Its purpose is to demonstrate how to install and configure packages (e.g., httpd), manage services, and copy files onto one or more managed nodes (EC2 instances) from a central control node.

##### File structure
- Top level:
- README.md, README - Copy.md (docs)
- ansible-playbook-basic.yaml, ansible-playbook-basic - Copy.yaml (actual playbooks)
- No nested “roles” or “group_vars” directories—this is a single-playbook, single-role example.
- No code beyond the playbook itself; no web frontend or database.

##### Extract key architectural hints from the README
- Control Node runs Ansible (requires Python + ansible binary).
- Managed Nodes (EC2) require only Python.
- Communication: push model over SSH (Ansible modules copy a small Python fragment, run it, then remove it).
- Inventory file (`slaves.txt` or `/etc/ansible/hosts`) lists managed-node IPs; config file (`ansible.cfg`) describes locations of inventory, SSH user, keyfile, become policy.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Control Plane Components
    subgraph "Control Plane" 
        direction TB
        CP["Control Node\n(Ansible + Python)"]:::control
        subgraph "Documentation"
            direction TB
            DOC1["README.md"]:::doc
            DOC2["README - Copy.md"]:::doc
        end
        subgraph "Configuration" 
            direction TB
            INV["Inventory (slaves.txt)"]:::config
            CFG["ansible.cfg"]:::config
        end
        subgraph "Playbooks"
            direction TB
            PB["ansible-playbook-basic.yaml\n- install httpd\n- start httpd\n- copy index.html"]:::play
            PBC["ansible-playbook-basic - Copy.yaml"]:::play
        end
    end

    %% Data Plane Components
    subgraph "Managed Nodes (Data Plane)" 
        direction TB
        MN1["Managed Node 1\n(Python + OS)"]:::managed
        MN2["Managed Node 2\n(Python + OS)"]:::managed
    end

    %% Relationships
    DOC1 --> CP
    DOC2 --> CP
    INV --> CP
    CFG --> CP
    PB --> CP
    PBC --> CP

    CP -->|"SSH (push)"| MN1
    CP -->|"SSH (push)"| MN2
    MN1 -->|"Status/Result"| CP
    MN2 -->|"Status/Result"| CP

    %% Click Events
    click DOC1 "https://github.com/devopsboy/ansible/blob/main/README.md"
    click DOC2 "https://github.com/devopsboy/ansible/blob/main/README - Copy.md"
    click PB "https://github.com/devopsboy/ansible/blob/main/ansible-playbook-basic.yaml"
    click PBC "https://github.com/devopsboy/ansible/blob/main/ansible-playbook-basic - Copy.yaml"

    %% Styles
    classDef control fill:#ADD8E6,stroke:#000;
    classDef config fill:#FFA500,stroke:#000;
    classDef play fill:#D3D3D3,stroke:#000;
    classDef doc fill:#87CEFA,stroke:#000;
    classDef managed fill:#90EE90,stroke:#000;
```
