# redborder/cookbook-rb-manager architecture

> Architecture diagram of the GitHub repository redborder/cookbook-rb-manager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/redborder/cookbook-rb-manager
- Repository: https://github.com/redborder/cookbook-rb-manager

## Overview

##### Project type and purpose
- This is an open-source Chef “cookbook” (infrastructure-as-code) named cookbook-rb-manager.
- Its goal is to configure a RedBorder manager node on Rocky Linux 9 using Chef (v15.7+).
- It defines custom resources, recipes, attributes and templates to install, configure and maintain the service.

##### File structure
- Top level:
- .github/workflows – CI workflows (linting, RPM build)
- packaging/rpm – spec file + Makefile to build an RPM of the cookbook
- resources/attributes – attribute defaults (platform, config parameters)
- resources/libraries – custom Ruby helper methods (e.g. get_cluster_info, get_sensors_info)
- resources/recipes – Chef recipes (default.rb, configure.rb, prepare_system.rb, cron tasks, journald)
- resources/templates – ERB templates for config files, cron jobs, systemd, motd, SSL certs
- Metadata, Gemfile, Makefile, README and LICENSE at top level govern dependencies, build, docs.

##### README for additional insights
- Platforms: Rocky Linux 9
- Requires Chef 15.7+
- CI badges show two GitHub Actions: lint and rpm packaging.

##### Details
- Order of recipe execution or indicate converge phases
- Packaging workflow steps (lint, build RPM, publish)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer and Source
    DevWorkstation["Developer Workstation"]:::dev
    GitHubRepo["GitHub Repository (cookbook-rb-manager)"]:::repo
    subgraph "Repo Files"
        Metadata["resources/metadata.rb"]:::data
        Gemfile["Gemfile"]:::data
        Readme["README.md"]:::data
        License["LICENSE"]:::data
        Changelog["CHANGELOG.md"]:::data
        Gitignore[".gitignore"]:::data
    end

    %% CI Pipeline
    subgraph "CI Pipeline"   
        LintWorkflow["Lint Workflow"]:::ci
        RPMWorkflow["RPM Packaging Workflow"]:::ci
        subgraph "Packaging/rpm"
            Spec["cookbook-rb-manager.spec"]:::ci
            MakefilePkg["Makefile"]:::ci
        end
    end

    %% Artifact and Infra
    ArtifactRepo["Artifact Store / Chef Server"]:::infra
    ManagedNode["Managed Node\n(Rocky Linux 9)"]:::node

    %% Managed Node Components
    subgraph "Managed Node Components"
        Attributes["Attributes"]:::data
        Libraries["Custom Libraries"]:::lib
        subgraph "Recipes"
            Prepare["prepare_system.rb"]:::proc
            Default["default.rb"]:::proc
            Configure["configure.rb"]:::proc
            Cron["configure_cron_tasks.rb"]:::proc
            Journald["configure_journald.rb"]:::proc
        end
        Templates["Templates"]:::data
    end

    ExternalAPI["External RedBorder APIs"]:::external

    %% Connections
    DevWorkstation -->|push changes| GitHubRepo
    GitHubRepo -->|triggers| LintWorkflow
    LintWorkflow -->|on success| RPMWorkflow
    RPMWorkflow -->|uses spec & Makefile| Spec
    RPMWorkflow --> MakefilePkg
    RPMWorkflow -->|publishes artifact| ArtifactRepo
    ArtifactRepo -->|provides cookbook/RPM| ManagedNode
    ManagedNode --> Attributes
    ManagedNode --> Libraries
    ManagedNode --> Prepare
    Prepare --> Default
    Default --> Configure
    Configure --> Cron
    Cron --> Journald
    ManagedNode --> Templates
    ManagedNode -->|API calls during converge| ExternalAPI

    GitHubRepo --> Metadata
    GitHubRepo --> Gemfile
    GitHubRepo --> Readme
    GitHubRepo --> License
    GitHubRepo --> Changelog
    GitHubRepo --> Gitignore

    %% Click Events
    click LintWorkflow "https://github.com/redborder/cookbook-rb-manager/blob/master/.github/workflows/lint.yml"
    click RPMWorkflow "https://github.com/redborder/cookbook-rb-manager/blob/master/.github/workflows/rpm.yml"
    click Spec "https://github.com/redborder/cookbook-rb-manager/blob/master/packaging/rpm/cookbook-rb-manager.spec"
    click MakefilePkg "https://github.com/redborder/cookbook-rb-manager/tree/master/packaging/rpm/Makefile"
    click Metadata "https://github.com/redborder/cookbook-rb-manager/blob/master/resources/metadata.rb"
    click Gemfile "https://github.com/redborder/cookbook-rb-manager/tree/master/Gemfile"
    click Readme "https://github.com/redborder/cookbook-rb-manager/blob/master/README.md"
    click License "https://github.com/redborder/cookbook-rb-manager/tree/master/LICENSE"
    click Changelog "https://github.com/redborder/cookbook-rb-manager/blob/master/CHANGELOG.md"
    click Gitignore "https://github.com/redborder/cookbook-rb-manager/blob/master/.gitignore"
    click Attributes "https://github.com/redborder/cookbook-rb-manager/blob/master/resources/attributes/default.rb"
    click Libraries "https://github.com/redborder/cookbook-rb-manager/tree/master/resources/libraries"
    click Prepare "https://github.com/redborder/cookbook-rb-manager/blob/master/resources/recipes/prepare_system.rb"
    click Default "https://github.com/redborder/cookbook-rb-manager/blob/master/resources/recipes/default.rb"
    click Configure "https://github.com/redborder/cookbook-rb-manager/blob/master/resources/recipes/configure.rb"
    click Cron "https://github.com/redborder/cookbook-rb-manager/blob/master/resources/recipes/configure_cron_tasks.rb"
    click Journald "https://github.com/redborder/cookbook-rb-manager/blob/master/resources/recipes/configure_journald.rb"
    click Templates "https://github.com/redborder/cookbook-rb-manager/tree/master/resources/templates/default"

    %% Styles
    classDef dev fill:#D0E6A5,stroke:#4B513B,color:#333
    classDef repo fill:#A9D0F5,stroke:#1E3A5F,color:#333
    classDef ci fill:#B0C4DE,stroke:#223344,color:#333
    classDef infra fill:#C2FABC,stroke:#145214,color:#333
    classDef node fill:#F5F5DC,stroke:#6B4423,color:#333
    classDef data fill:#FFE4B5,stroke:#B27300,color:#333
    classDef lib fill:#FFF5BA,stroke:#A67C00,color:#333
    classDef proc fill:#E6E6FA,stroke:#6A5ACD,color:#333
    classDef external fill:#F4CCCC,stroke:#992222,color:#333
```
