# damyrfr/ansible-personal-computer architecture

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

- Interactive diagram: https://gitdiagram.com/damyrfr/ansible-personal-computer
- Repository: https://github.com/damyrfr/ansible-personal-computer

## Overview

##### Component Details

a) Initialization Layer:
- "firstrun" command as an entry point

b) Configuration Management Layer:
- Requirements.yml and requirements.txt as dependencies

c) Role-based Configuration Layer:
Create six connected modules representing the Ansible roles:

##### Dotfiles Role
- Configuration files (.vimrc, .tmux.conf, .zshrc, etc.)
- Git configuration

##### GNOME Role
- Desktop environment configuration
- Theme settings
- Font management

##### Packages Role
- Package management (apt)
- Tool installation (asdf, Firefox, Neovim)
- Application configuration

##### Security Role
- System hardening
- PAM configuration
- RKHunter setup
- File permissions

##### System Role
- DNS configuration
- System-wide settings

##### User Role
- User management
- User-specific configurations

d) Target System Layer:
- Desktop Environment (GNOME)
- Development Tools (Neovim, Zellij)
- System Security
- User Environment

##### Important Relationships

- Makefile → Ansible Playbook
- Ansible Playbook → Roles
- Roles → Configuration Files
- Roles → System Components
- Variable Files → Roles

##### Additional Details

- File types (.yml, .j2, .conf)
- Role categories (system, application, security)
- Configuration flow types
- External dependencies

##### Notes for Implementation

- Version information for major components
- Notes about external dependencies (like the separate Neovim configuration repository)

Remember to maintain a balance between showing the complexity of the system while keeping it readable and understandable at a glance. The focus should be on the role-based architecture and how it achieves the final system configuration.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef init fill:#e6f3ff,stroke:#4a90e2
    classDef ansible fill:#fff5e6,stroke:#ff9900
    classDef role fill:#e6ffe6,stroke:#2eb82e
    classDef config fill:#ffe6e6,stroke:#ff4d4d
    classDef system fill:#f0f0f0,stroke:#666666
    classDef vars fill:#e6e6ff,stroke:#4d4dff

    %% Initialization Layer
    Init["Makefile (firstrun)"]:::init
    click Init "https://github.com/DamyrFr/ansible-personal-computer/tree/master/Makefile"

    %% Configuration Management Layer
    AnsiblePlaybook["Ansible Playbook\n(computer.yml)"]:::ansible
    click AnsiblePlaybook "https://github.com/DamyrFr/ansible-personal-computer/blob/master/computer.yml"
    Requirements["Requirements Files\n(requirements.yml, requirements.txt)"]:::ansible
    click Requirements "https://github.com/DamyrFr/ansible-personal-computer/blob/master/requirements.yml"

    %% Variables
    subgraph Variables
        PackageVars["Package Variables"]:::vars
        click PackageVars "https://github.com/DamyrFr/ansible-personal-computer/blob/master/vars/packages.yml"
        SystemVars["System Variables"]:::vars
        click SystemVars "https://github.com/DamyrFr/ansible-personal-computer/blob/master/vars/system.yml"
        UserVars["User Variables"]:::vars
        click UserVars "https://github.com/DamyrFr/ansible-personal-computer/blob/master/vars/user.yml"
    end

    %% Roles Layer
    subgraph Roles
        DotfilesRole["Dotfiles Role"]:::role
        click DotfilesRole "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/dotfiles/tasks/main.yml"
        GnomeRole["GNOME Role"]:::role
        click GnomeRole "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/gnome/tasks/main.yml"
        PackagesRole["Packages Role"]:::role
        click PackagesRole "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/packages/tasks/main.yml"
        SecurityRole["Security Role"]:::role
        click SecurityRole "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/security/tasks/main.yml"
        SystemRole["System Role"]:::role
        click SystemRole "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/system/tasks/main.yml"
        UserRole["User Role"]:::role
        click UserRole "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/user/tasks/main.yml"
    end

    %% Role Components
    subgraph DotfilesComponents
        GitConfig["Git Configuration"]:::config
        click GitConfig "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/dotfiles/templates/gitconfig.j2"
        DotfilesConfig["Dotfiles Configuration"]:::config
        click DotfilesConfig "https://github.com/DamyrFr/ansible-personal-computer/tree/master/roles/dotfiles/files/"
    end

    subgraph GnomeComponents
        DconfConfig["Desktop Environment"]:::config
        click DconfConfig "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/gnome/tasks/dconf.yml"
        ThemeConfig["Theme Configuration"]:::config
        click ThemeConfig "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/gnome/tasks/theme.yml"
        FontConfig["Font Management"]:::config
        click FontConfig "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/gnome/tasks/fonts.yml"
    end

    subgraph PackagesComponents
        Firefox["Firefox Setup"]:::config
        click Firefox "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/packages/tasks/firefox.yml"
        Neovim["Neovim Setup"]:::config
        click Neovim "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/packages/tasks/neovim.yml"
        ASDF["ASDF Tool Manager"]:::config
        click ASDF "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/packages/tasks/asdf.yml"
    end

    subgraph SecurityComponents
        PAMConfig["PAM Configuration"]:::config
        click PAMConfig "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/security/tasks/pam.yml"
        RKHunter["RKHunter Setup"]:::config
        click RKHunter "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/security/tasks/rkhunter.yml"
        FilePerms["File Permissions"]:::config
        click FilePerms "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/security/tasks/file_perm.yml"
        SysCtl["System Control"]:::config
        click SysCtl "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/security/tasks/sysctl.yml"
    end

    subgraph SystemComponents
        DNSConfig["DNS Configuration"]:::config
        click DNSConfig "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/system/tasks/dns.yml"
        DNSTemplate["DNS Template"]:::config
        click DNSTemplate "https://github.com/DamyrFr/ansible-personal-computer/blob/master/roles/system/templates/resolv.conf.j2"
    end

    %% Connections
    Init --> AnsiblePlaybook
    AnsiblePlaybook --> Requirements
    AnsiblePlaybook --> Variables
    AnsiblePlaybook --> Roles

    %% Role Connections
    DotfilesRole --> DotfilesComponents
    GnomeRole --> GnomeComponents
    PackagesRole --> PackagesComponents
    SecurityRole --> SecurityComponents
    SystemRole --> SystemComponents

    %% Variable Connections
    PackageVars -.-> PackagesRole
    SystemVars -.-> SystemRole
    UserVars -.-> UserRole

    %% Legend
    subgraph Legend
        L1["Configuration File"]:::config
        L2["Ansible Role"]:::role
        L3["Variable File"]:::vars
        L4["System Component"]:::system
    end
```
