# etriad/infrastructure-agent-puppet architecture

> Architecture diagram of the GitHub repository etriad/infrastructure-agent-puppet, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/etriad/infrastructure-agent-puppet
- Repository: https://github.com/etriad/infrastructure-agent-puppet

## Overview

##### Main Components

a. Core Components:
- Puppet Module Manager
- New Relic Infrastructure Agent
- Package Repository Manager
- Integration Manager
- Configuration Manager

b. External Components:
- New Relic Backend Services
- Package Repositories (OS-specific)
- On-Host Integrations

**Top Layer: External Services**
**Middle Layer: Puppet Module Components**
**Bottom Layer: Host System**

##### Key Relationships

- Data flow from the Infrastructure Agent to New Relic's backend
- Relationship between the Integration Manager and On-Host Integrations
- Package repository connections

##### Component Details

- Rectangles (Blue): Core Puppet module components
- Hexagons (Green): External services
- Rounded rectangles (Orange): Configuration elements

##### Specific Implementation Details

a. Configuration Flow:
- License key management
- Custom attributes
- Integration configurations
- Agent configurations

b. Platform Support:
- Multi-platform support (Windows, Linux variants)
- Package management systems (rpm, deb, msi)

##### Elements

- Version management flow
- Repository management options
- Integration installation paths
- Configuration template processing
- Platform-specific paths

##### Specific Implementation Notes

- The modular nature of the integration system
- The configuration hierarchy
- Platform-specific implementation differences
- Repository management options

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph External["External Services"]
        NRB[New Relic Backend Services]:::external
        PR[(Package Repositories)]:::storage
    end

    subgraph PuppetModule["Puppet Module Components"]
        PMM[Puppet Module Manager]:::core
        click PMM "https://github.com/etriad/infrastructure-agent-puppet/blob/master/manifests/init.pp"
        
        subgraph AgentManagement["Agent Management"]
            NRA[New Relic Infrastructure Agent]:::agent
            click NRA "https://github.com/etriad/infrastructure-agent-puppet/blob/master/manifests/agent.pp"
            
            CM[Configuration Manager]:::config
            click CM "https://github.com/etriad/infrastructure-agent-puppet/blob/master/data/common.yaml"
            
            AT[Agent Templates]:::template
            click AT "https://github.com/etriad/infrastructure-agent-puppet/blob/master/templates/newrelic-infra.yml.erb"
        end

        subgraph IntegrationSystem["Integration System"]
            IM[Integration Manager]:::integration
            click IM "https://github.com/etriad/infrastructure-agent-puppet/blob/master/manifests/integrations.pp"
            IC[Integration Configs]:::config
        end

        subgraph CI["CI/CD Pipeline"]
            GHA[GitHub Actions]:::cicd
            click GHA "https://github.com/etriad/infrastructure-agent-puppet/blob/master/.github/workflows/main.yml"
            
            TF[Testing Framework]:::testing
            click TF "https://github.com/etriad/infrastructure-agent-puppet/blob/master/spec/classes/agent_spec.rb"
        end
    end

    subgraph HostSystem["Host System"]
        OHI[On-Host Integrations]:::host
        PS[Platform Services]:::host
    end

    %% Relationships
    PMM --> NRA
    PMM --> IM
    PMM --> CM
    NRA --> NRB
    PR --> NRA
    IM --> OHI
    CM --> AT
    AT --> NRA
    IC --> OHI
    PS --> NRA
    GHA --> TF
    TF --> PMM

    %% Styles
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef agent fill:#e74c3c,stroke:#c0392b,color:white
    classDef config fill:#f1c40f,stroke:#f39c12,color:black
    classDef integration fill:#2ecc71,stroke:#27ae60,color:white
    classDef template fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef host fill:#e67e22,stroke:#d35400,color:white
    classDef external fill:#9b59b6,stroke:#8e44ad,color:white
    classDef storage fill:#34495e,stroke:#2c3e50,color:white
    classDef testing fill:#1abc9c,stroke:#16a085,color:white
    classDef cicd fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[Agent Components]:::agent
        L3[Configuration]:::config
        L4[Integration]:::integration
        L5[Templates]:::template
        L6[Host Components]:::host
        L7[External Services]:::external
        L8[Storage]:::storage
        L9[Testing]:::testing
        L10[CI/CD]:::cicd
    end
```
