# geerlingguy/mac-dev-playbook architecture

> Architecture diagram of the GitHub repository geerlingguy/mac-dev-playbook, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/geerlingguy/mac-dev-playbook
- Repository: https://github.com/geerlingguy/mac-dev-playbook

## Overview

##### Main Components

a. Control Flow Layer:
- Ansible Controller (central component)
- Inventory Management
- Configuration Management
- Task Execution Engine

b. Configuration Components:
- Default Configuration (default.config.yml)
- User Override Configuration (config.yml)
- Requirements Management (requirements.yml)

c. Task Groups:
- Package Managers (Homebrew, Pip, NPM, Gem)
- System Configuration
- Application Installation
- Development Tools Setup

##### Relationship Structure

- Create four main quadrants around it:
1. Input/Configuration (top-left)
2. Task Execution (top-right)
3. Package Management (bottom-left)
4. System Configuration (bottom-right)

##### Specific Elements

a. Input/Configuration Section:
- default.config.yml
- user config.yml
- inventory file
- requirements.yml

b. Task Execution Section:
- Task Runners
- extra-packages.yml
- osx.yml
- sublime-text.yml
- terminal.yml
- sudoers.yml

c. Package Management Section:
- Homebrew
- Pip
- NPM
- Gem
- Mac App Store

d. System Configuration Section:
- dotfiles
- Terminal settings
- Sublime Text configuration
- macOS system preferences

##### Important Flows to Highlight

- Configuration file processing → Ansible Controller
- Ansible Controller → Task Execution
- Task Execution → Package Managers
- Package Managers → Target System
- Configuration → System Settings

##### Notes Section

A small notes section indicating:
- Required permissions/sudo access
- System requirements
- Override capabilities
- Remote execution capabilities

Remember to emphasize the idempotent nature of the playbook and its ability to work both locally and remotely, as these are key architectural features of the system.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Input
        DC[Default Configuration]
        UC[User Configuration]
        IM[Inventory Management]
        RM[Requirements Management]
    end

    subgraph Core
        AC[Ansible Controller]
        TE[Task Execution Engine]
    end

    subgraph "Task Groups"
        PM[Package Management]
        SC[System Configuration]
        ST[Sublime Text Setup]
        TC[Terminal Configuration]
        SP[System Permissions]
    end

    subgraph "Package Managers"
        HB[Homebrew]
        PIP[Pip]
        NPM[NPM]
        GEM[Gem]
        MAS["Mac App Store"]
    end

    subgraph "Testing & CI"
        TE_ENV[Test Environment]
        CI[GitHub Actions]
    end

    subgraph Prerequisites
        XC[Xcode CLI Tools]
        PY[Python/Pip]
        AI[Ansible Installation]
    end

    %% Core Relationships
    DC --> AC
    UC --> AC
    IM --> AC
    RM --> AC
    AC --> TE
    TE --> PM
    TE --> SC
    TE --> ST
    TE --> TC
    TE --> SP

    %% Package Management Flow
    PM --> HB
    PM --> PIP
    PM --> NPM
    PM --> GEM
    PM --> MAS

    %% Testing Flow
    AC --> TE_ENV
    TE_ENV --> CI

    %% Prerequisites Flow
    XC --> AI
    PY --> AI
    AI --> AC

    %% Styling
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef config fill:#2ecc71,stroke:#27ae60,color:white
    classDef task fill:#e67e22,stroke:#d35400,color:white
    classDef package fill:#9b59b6,stroke:#8e44ad,color:white
    classDef test fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef prereq fill:#34495e,stroke:#2c3e50,color:white

    class AC,TE core
    class DC,UC,IM,RM config
    class PM,SC,ST,TC,SP task
    class HB,PIP,NPM,GEM,MAS package
    class TE_ENV,CI test
    class XC,PY,AI prereq

    %% Click Events
    click AC "https://github.com/geerlingguy/mac-dev-playbook/blob/master/main.yml"
    click DC "https://github.com/geerlingguy/mac-dev-playbook/blob/master/default.config.yml"
    click IM "https://github.com/geerlingguy/mac-dev-playbook/tree/master/inventory"
    click RM "https://github.com/geerlingguy/mac-dev-playbook/blob/master/requirements.yml"
    click PM "https://github.com/geerlingguy/mac-dev-playbook/blob/master/tasks/extra-packages.yml"
    click SC "https://github.com/geerlingguy/mac-dev-playbook/blob/master/tasks/osx.yml"
    click ST "https://github.com/geerlingguy/mac-dev-playbook/blob/master/tasks/sublime-text.yml"
    click TC "https://github.com/geerlingguy/mac-dev-playbook/blob/master/tasks/terminal.yml"
    click SP "https://github.com/geerlingguy/mac-dev-playbook/blob/master/tasks/sudoers.yml"
    click TE_ENV "https://github.com/geerlingguy/mac-dev-playbook/tree/master/tests"
    click CI "https://github.com/geerlingguy/mac-dev-playbook/blob/master/.github/workflows/ci.yml"
```
