# loganmarchione/ansible-arch-linux architecture

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

- Interactive diagram: https://gitdiagram.com/loganmarchione/ansible-arch-linux
- Repository: https://github.com/loganmarchione/ansible-arch-linux

## Overview

##### Project type and purpose
- This is an Infrastructure-as-Code (IaC) project using Ansible to automate the post-installation configuration of a single Arch Linux machine (the “managed node”), driven from a control environment (the “control node”).
- The README confirms it’s a personal playbook that runs locally (against localhost), installing packages, configuring system files, creating users, and enabling services in a reproducible, idempotent fashion.

##### File structure
- Top-level:
- `main.yml` – the root playbook orchestrating execution.
- `hosts` – the inventory defining `localhost` (or other targets).
- `group_vars/all.yml` – global variables applied to all hosts.
- `ansible.cfg` + linting configs – control defaults, roles_path, callback plugins, etc.
- `roles/01_*` through `roles/10_*` – ten ordered Ansible roles, each encapsulating a slice of configuration.
- Roles breakdown:
01_host_info (gather facts)
02_basics (mirrorlist, pacman.conf, reflector)
03_display_server (X11 / Wayland server setup)
04_desktop (desktop environment packages & settings)
05_packages (AUR, Flatpak, fonts)
06_microcode (CPU microcode updates)
07_users (user accounts, `makepkg.conf`)
08_printing_scanning (CUPS, scanners)
09_bluetooth (Bluetooth stack)
10_laptop (laptop-specific tweaks)
- CI: `.github/workflows/lint.yml` triggers ansible-lint via GitHub Actions on every push/PR. Dependencies are pinned in `requirements.yml` (Ansible Galaxy roles) and `requirements.txt` (Python packages).

##### README for additional insights
- It's explicitly designed to be run after base Arch install (partitioning, fstab, chroot, user bootstrap).
- Instructions show a local Python virtualenv, pip installation, Galaxy role installation, check mode, then full apply.

##### Elements
- Blue for source/control (GitHub, Control Node)
- Green for managed host
- Orange for external dependencies (Ansible Galaxy, package repos)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "GitHub Repository"
        direction TB
        GITIGNORE[".gitignore"]:::source
        LICENSE["LICENSE"]:::source
        README["README.md"]:::source
        GITHUB_DIR[".github/"]:::source
    end
    subgraph "CI/CD Layer"
        direction TB
        CI["GitHub Actions: ansible-lint"]:::source
        LINTCFG[".ansible-lint"]:::source
        YAMLLINT[".yamllint.yml"]:::source
        LINTWF[".github/workflows/lint.yml"]:::source
    end
    subgraph "Control Node"
        direction TB
        Setup["Setup Environment\n(venv, pip)"]:::source
        Run["Run Playbook"]:::source
    end
    subgraph "Playbook Execution"
        direction TB
        ANSIBLECFG["ansible.cfg"]:::source
        HOSTS["hosts"]:::source
        GROUPVARS["group_vars/all.yml"]:::source
        MAIN["main.yml"]:::source
        subgraph "Roles Execution"
            direction TB
            R01["01_host_info"]:::source
            R02["02_basics"]:::source
            R02T1["mirrorlist"]:::source
            R02T2["pacman.conf.j2"]:::source
            R02T3["reflector.conf.j2"]:::source
            R03["03_display_server"]:::source
            R04["04_desktop"]:::source
            R05["05_packages"]:::source
            R05T1["aur.yml"]:::source
            R05T2["flatpak.yml"]:::source
            R05T3["fonts.yml"]:::source
            R06["06_microcode"]:::source
            R07["07_users"]:::source
            R07T["makepkg.conf"]:::source
            R08["08_printing_scanning"]:::source
            R09["09_bluetooth"]:::source
            R10["10_laptop"]:::source
        end
    end
    External["External Services\n(Ansible Galaxy, AUR, Flatpak)"]:::external
    Managed["Arch Linux Target (localhost)"]:::managed

    %% Connections
    GITIGNORE -->|part of repo| CI
    LICENSE -->|part of repo| CI
    README -->|part of repo| CI
    GITHUB_DIR -->|part of repo| CI
    GITHUB_DIR -->|part of repo| Setup
    CI -->|lint on push| CI
    GITHUB_DIR -->|git clone| Setup
    Setup -->|pip install| Setup
    Setup -->|ansible-galaxy install| Run
    Run -->|reads inventory & vars| ANSIBLECFG
    ANSIBLECFG --> HOSTS
    HOSTS --> GROUPVARS
    GROUPVARS --> MAIN
    MAIN --> R01
    R01 --> R02
    R02 --> R02T1
    R02 --> R02T2
    R02 --> R02T3
    R02 --> R03
    R03 --> R04
    R04 --> R05
    R05 --> R05T1
    R05 --> R05T2
    R05 --> R05T3
    R05 --> R06
    R06 --> R07
    R07 --> R07T
    R07 --> R08
    R08 --> R09
    R09 --> R10
    R10 --> Managed
    Run -->|executes via SSH/local| Managed
    Managed -->|fetch packages| External
    Run -->|uses external roles| External

    %% Click Events
    click GITIGNORE "https://github.com/loganmarchione/ansible-arch-linux/blob/main/.gitignore"
    click LICENSE "https://github.com/loganmarchione/ansible-arch-linux/tree/main/LICENSE"
    click README "https://github.com/loganmarchione/ansible-arch-linux/blob/main/README.md"
    click GITHUB_DIR "https://github.com/loganmarchione/ansible-arch-linux/tree/main/.github/"
    click CI "https://github.com/loganmarchione/ansible-arch-linux/blob/main/.github/workflows/lint.yml"
    click LINTCFG "https://github.com/loganmarchione/ansible-arch-linux/blob/main/.ansible-lint"
    click YAMLLINT "https://github.com/loganmarchione/ansible-arch-linux/blob/main/.yamllint.yml"
    click LINTWF "https://github.com/loganmarchione/ansible-arch-linux/blob/main/.github/workflows/lint.yml"
    click Setup "https://github.com/loganmarchione/ansible-arch-linux/blob/main/requirements.txt"
    click Setup "https://github.com/loganmarchione/ansible-arch-linux/blob/main/requirements.yml"
    click Run "https://github.com/loganmarchione/ansible-arch-linux/blob/main/ansible.cfg"
    click HOSTS "https://github.com/loganmarchione/ansible-arch-linux/tree/main/hosts"
    click GROUPVARS "https://github.com/loganmarchione/ansible-arch-linux/blob/main/group_vars/all.yml"
    click MAIN "https://github.com/loganmarchione/ansible-arch-linux/blob/main/main.yml"
    click R01 "https://github.com/loganmarchione/ansible-arch-linux/blob/main/roles/01_host_info/tasks/main.yml"
    click R02 "https://github.com/loganmarchione/ansible-arch-linux/blob/main/roles/02_basics/tasks/main.yml"
    click R02T1 "https://github.com/loganmarchione/ansible-arch-linux/tree/main/roles/02_basics/templates/mirrorlist"
    click R02T2 "https://github.com/loganmarchione/ansible-arch-linux/blob/main/roles/02_basics/templates/pacman.conf.j2"
    click R02T3 "https://github.com/loganmarchione/ansible-arch-linux/blob/main/roles/02_basics/templates/reflector.conf.j2"
    click R03 "https://github.com/loganmarchione/ansible-arch-linux/blob/main/roles/03_display_server/tasks/main.yml"
    click R04 "https://github.com/loganmarchione/ansible-arch-linux/blob/main/roles/04_desktop/tasks/main.yml"
    click R05 "https://github.com/loganmarchione/ansible-arch-linux/blob/main/roles/05_packages/tasks/main.yml"
    click R05T1 "https://github.com/loganmarchione/ansible-arch-linux/blob/main/roles/05_packages/tasks/aur.yml"
    click R05T2 "https://github.com/loganmarchione/ansible-arch-linux/blob/main/roles/05_packages/tasks/flatpak.yml"
    click R05T3 "https://github.com/loganmarchione/ansible-arch-linux/blob/main/roles/05_packages/tasks/fonts.yml"
    click R06 "https://github.com/loganmarchione/ansible-arch-linux/blob/main/roles/06_microcode/tasks/main.yml"
    click R07 "https://github.com/loganmarchione/ansible-arch-linux/blob/main/roles/07_users/tasks/main.yml"
    click R07T "https://github.com/loganmarchione/ansible-arch-linux/blob/main/roles/07_users/templates/makepkg.conf"
    click R08 "https://github.com/loganmarchione/ansible-arch-linux/blob/main/roles/08_printing_scanning/tasks/main.yml"
    click R09 "https://github.com/loganmarchione/ansible-arch-linux/blob/main/roles/09_bluetooth/tasks/main.yml"
    click R10 "https://github.com/loganmarchione/ansible-arch-linux/blob/main/roles/10_laptop/tasks/main.yml"

    %% Styles
    classDef source fill:#cce5ff,stroke:#004085
    classDef managed fill:#d4edda,stroke:#155724
    classDef external fill:#fff3cd,stroke:#856404
```
