# iam-veeramalla/ansible-zero-to-hero architecture

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

- Interactive diagram: https://gitdiagram.com/iam-veeramalla/ansible-zero-to-hero
- Repository: https://github.com/iam-veeramalla/ansible-zero-to-hero

## Overview

##### Project type and purpose
- This repository, “Ansible Zero to Hero,” is essentially an educational/tutorial project (open-source training material) that walks a learner through Ansible concepts, from basic commands to advanced use cases (Vault, Tower, network automation, Terraform integration).
- Its “runtime” artifacts are Ansible playbooks, roles, inventories, and example scripts invoked against cloud infra (AWS EC2).

##### Main components
a. Documentation Layer
- Markdown files (Day-01 through Day-14) containing theory, examples, and step-by-step guides.
- These drive the user’s journey through concepts.
b. Code/Artifact Layer
- Playbook files (`*.yaml` in Day-folders, e.g., `first-playbook.yaml`, `ec2_create.yaml`, etc.).
- Roles (implicitly introduced in Day-04 and Day-05).
- Inventories (`inventory.ini`).
- Variable files and Jinja2 templates (used across playbooks).
c. Execution Engine
- Ansible CLI/engine: reads inventories, playbooks, roles, variables, modules/plugins to orchestrate changes.
d. External Services & Integrations
- AWS EC2 (Day-07 demos).
- Ansible Galaxy (Day-05 role publishing/installation).
- Vault for secrets management (Day-09).
- Tower/AWX (Day-12).
- Terraform (Day-13) integrating with Ansible.

##### Relationships & data flows
- User (learner) reads Markdown → invokes specific Playbook via Ansible CLI → CLI loads Inventory + Variables + Roles + Modules → CLI issues API calls to target systems (e.g., AWS EC2 or network devices).
- For Galaxy: CLI connects to Galaxy API to fetch/publish roles.
- For Vault: CLI pulls encrypted files, decrypts them, supplies secrets to playbooks.
- For Tower: user interacts with a Web UI/API, which in turn invokes the Ansible engine.
- For Terraform + Ansible: Terraform provisions infra, then hands off to Ansible modules.

##### Architectural patterns & design principles
- Modularization via Roles (separation of concerns: tasks, handlers, defaults, vars, templates).
- Inventory-driven execution (decoupling hosts from playbook logic).
- Reusable collections/plugins (Day-06).
- Declarative YAML structure.
- Layered orchestration: CLI → Engine → Modules → Remote API/SSH.

## Diagram (Mermaid)

```mermaid
graph TD
    %% User Layer
    User["User / Learner"] 

    %% Documentation Layer
    subgraph "Documentation Layer"
        classDef docs fill:#D0E8FF,stroke:#0366D6;
        MD1["Day-01 Intro"]:::docs
        MD2["Day-01 Shell vs Ansible"]:::docs
        MD3["Day-02 Passwordless Auth"]:::docs
        MD4["Day-02 Inventory"]:::docs
        MD5["Day-03 YAML Basics"]:::docs
        MD6["Day-03 Playbook Components"]:::docs
        MD7["Day-04 Roles"]:::docs
        MD8["Day-05 Push Role to Galaxy"]:::docs
        MD9["Day-06 Prereq"]:::docs
        MD10["Day-07 README"]:::docs
        MD11["Day-10 Install & Setup"]:::docs
        MD12["Day-10 README"]:::docs
    end

    %% Execution & Orchestration Layer
    subgraph "Execution & Orchestration"
        classDef exec fill:#FFE5B4,stroke:#CC5500;
        CLI["Ansible CLI / Engine"]:::exec
        subgraph "Artifacts"
            classDef artifacts fill:#E2F0D9,stroke:#3C763D;
            Inv["Inventory (inventory.ini)"]:::artifacts
            PB1["First Playbook"]:::artifacts
            PB2["Sample Playbook"]:::artifacts
            PB3["AWS EC2 Playbooks"]:::artifacts
            PB4["Error Handling Playbook"]:::artifacts
            PB5["Additional Day-10 Playbook"]:::artifacts
            Roles["Roles & Collections"]:::artifacts
            Vars["Vars & Jinja2 Templates"]:::artifacts
        end
    end

    %% External Services Layer
    subgraph "External Services & Integrations"
        classDef external fill:#E7D9FF,stroke:#5F259F;
        AWS["AWS EC2"]:::external
        Net["Network Devices"]:::external
        Local["Local Hosts"]:::external
        Galaxy["Ansible Galaxy"]:::external
        Vault["Vault"]:::external
        TowerUI["Tower UI"]:::external
        TowerAPI["Tower API"]:::external
        Terraform["Terraform"]:::external
    end

    %% Relationships
    User -->|reads| MD1
    User -->|reads| MD2
    User -->|reads| MD3
    User -->|reads| MD4
    User -->|reads| MD5
    User -->|reads| MD6
    User -->|reads| MD7
    User -->|reads| MD8
    User -->|reads| MD9
    User -->|reads| MD10
    User -->|reads| MD11
    User -->|reads| MD12

    User -->|invokes| CLI

    Inv ---|input| CLI
    PB1 ---|input| CLI
    PB2 ---|input| CLI
    PB3 ---|input| CLI
    PB4 ---|input| CLI
    PB5 ---|input| CLI
    Roles ---|input| CLI
    Vars ---|input| CLI

    CLI -->|SSH/API| AWS
    CLI -->|SSH| Net
    CLI -->|SSH| Local

    CLI <-->|fetch/publish| Galaxy
    CLI <-->|decrypt/encrypt| Vault

    TowerUI -->|UI/API call| TowerAPI
    TowerAPI -->|invoke| CLI

    Terraform -->|provision & handoff| CLI

    %% Click Events for Documentation
    click MD1 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-01/01-introduction.md"
    click MD2 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-01/02-shell-vs-ansible.md"
    click MD3 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-02/01-passwordless-authentication.md"
    click MD4 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-02/02-inventory.md"
    click MD5 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-03/01-yaml-basics.md"
    click MD6 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-03/02-ansible-playbook-components.md"
    click MD7 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-04/01-roles.md"
    click MD8 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-05/01-push-role-to-galaxy.md"
    click MD9 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-06/01-prereq.md"
    click MD10 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-07/README.md"
    click MD11 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-10/01-install-and-setup.md"
    click MD12 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-10/README.md"

    %% Click Events for Playbooks and Inventory
    click PB1 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-03/03-first-playbook/first-playbook.yaml"
    click PB2 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-06/02-playbook.yaml"
    click PB3 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-07/ec2_create.yaml"
    click PB3 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-07/ec2_shutdown.yaml"
    click PB4 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-08/01-error-handling.yaml"
    click Inv "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-08/inventory.ini"
    click PB5 "https://github.com/iam-veeramalla/ansible-zero-to-hero/blob/main/Day-10/02-playbook.yaml"

    %% Styles
    class MD1,MD2,MD3,MD4,MD5,MD6,MD7,MD8,MD9,MD10,MD11,MD12 docs
    class Inv,PB1,PB2,PB3,PB4,PB5,Roles,Vars artifacts
    class CLI exec
    class AWS,Net,Local,Galaxy,Vault,TowerUI,TowerAPI,Terraform external
```
