# graylog2/graylog-ansible-role architecture

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

- Interactive diagram: https://gitdiagram.com/graylog2/graylog-ansible-role
- Repository: https://github.com/graylog2/graylog-ansible-role

## Overview

This repository is an Ansible role for installing and configuring Graylog on Linux hosts. The main workflow is a playbook invoking the role, which prepares the host, installs/configures Graylog, and supplies service configuration; the README also documents optional Java installation and external OpenSearch and MongoDB dependencies. The task and template files were not excerpted, so internal task-to-task wiring is shown only as unverified dashed links; documented product relationships cite the README.

Main entry points: [`tasks/server.yml`](https://github.com/graylog2/graylog-ansible-role/blob/master/tasks/server.yml) (Graylog setup), [`tasks/main.yml`](https://github.com/graylog2/graylog-ansible-role/blob/master/tasks/main.yml) (Role entry), [`tasks/setup-Debian.yml`](https://github.com/graylog2/graylog-ansible-role/blob/master/tasks/setup-Debian.yml) (OS setup), [`tasks/setup-RedHat.yml`](https://github.com/graylog2/graylog-ansible-role/blob/master/tasks/setup-RedHat.yml) (Red Hat setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Role orchestration"]
  node_entry["Role entry<br/>[main.yml]"]
  node_platform["OS setup<br/>[setup-Debian.yml]"]
  node_redhat["Red Hat setup<br/>[setup-RedHat.yml]"]
  node_server["Graylog setup<br/>[server.yml]"]
end

subgraph group_configuration["Host configuration"]
  node_defaults["Role defaults<br/>[main.yml]"]
  node_vars["Role variables<br/>[main.yml]"]
  node_debianvars["Debian variables<br/>[Debian.yml]"]
  node_redhatvars["Red Hat variables<br/>[RedHat.yml]"]
  node_serverconf["Server config"]
  node_serviceconf["Service defaults"]
  node_handlers["Service handlers<br/>[main.yml]"]
end

subgraph group_dependencies["Graylog dependencies"]
  node_graylog["Graylog server"]
  node_java["Java runtime"]
  node_opensearch[("OpenSearch")]
  node_mongodb[("MongoDB")]
end

node_operator(("Playbook operator"))
node_host["Linux host"]

node_operator -->|"invokes role"| node_entry
node_entry -.->|"selects setup"| node_platform
node_entry -.->|"configures server"| node_server
node_platform -.->|"prepares host"| node_host
node_redhat -.->|"prepares host"| node_host
node_server -->|"installs Graylog"| node_graylog
node_server -.->|"uses template"| node_serverconf
node_server -.->|"uses template"| node_serviceconf
node_server -.->|"notifies service"| node_handlers
node_server -.->|"reads settings"| node_defaults
node_server -.->|"reads settings"| node_vars
node_platform -.->|"loads variables"| node_debianvars
node_redhat -.->|"loads variables"| node_redhatvars
node_graylog -->|"requires runtime"| node_java
node_graylog -->|"depends on"| node_opensearch
node_graylog -->|"depends on"| node_mongodb

click node_entry "https://github.com/graylog2/graylog-ansible-role/blob/master/tasks/main.yml"
click node_platform "https://github.com/graylog2/graylog-ansible-role/blob/master/tasks/setup-Debian.yml"
click node_redhat "https://github.com/graylog2/graylog-ansible-role/blob/master/tasks/setup-RedHat.yml"
click node_server "https://github.com/graylog2/graylog-ansible-role/blob/master/tasks/server.yml"
click node_defaults "https://github.com/graylog2/graylog-ansible-role/blob/master/defaults/main.yml"
click node_vars "https://github.com/graylog2/graylog-ansible-role/blob/master/vars/main.yml"
click node_debianvars "https://github.com/graylog2/graylog-ansible-role/blob/master/vars/Debian.yml"
click node_redhatvars "https://github.com/graylog2/graylog-ansible-role/blob/master/vars/RedHat.yml"
click node_serverconf "https://github.com/graylog2/graylog-ansible-role/blob/master/templates/graylog.server.conf.j2"
click node_serviceconf "https://github.com/graylog2/graylog-ansible-role/blob/master/templates/graylog.server.default.j2"
click node_handlers "https://github.com/graylog2/graylog-ansible-role/blob/master/handlers/main.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_platform,node_redhat,node_server toneBlue
class node_defaults,node_vars,node_debianvars,node_redhatvars,node_serverconf,node_serviceconf,node_handlers toneAmber
class node_graylog,node_java,node_opensearch,node_mongodb toneMint
class node_operator,node_host toneIndigo
```

## Components

### Role orchestration

- [Role entry](https://github.com/graylog2/graylog-ansible-role/blob/master/tasks/main.yml): `tasks/main.yml`
- [OS setup](https://github.com/graylog2/graylog-ansible-role/blob/master/tasks/setup-Debian.yml): `tasks/setup-Debian.yml`
- [Red Hat setup](https://github.com/graylog2/graylog-ansible-role/blob/master/tasks/setup-RedHat.yml): `tasks/setup-RedHat.yml`
- [Graylog setup](https://github.com/graylog2/graylog-ansible-role/blob/master/tasks/server.yml): `tasks/server.yml`

### Host configuration

- [Role defaults](https://github.com/graylog2/graylog-ansible-role/blob/master/defaults/main.yml): `defaults/main.yml`
- [Role variables](https://github.com/graylog2/graylog-ansible-role/blob/master/vars/main.yml): `vars/main.yml`
- [Debian variables](https://github.com/graylog2/graylog-ansible-role/blob/master/vars/Debian.yml): `vars/Debian.yml`
- [Red Hat variables](https://github.com/graylog2/graylog-ansible-role/blob/master/vars/RedHat.yml): `vars/RedHat.yml`
- [Server config](https://github.com/graylog2/graylog-ansible-role/blob/master/templates/graylog.server.conf.j2): `templates/graylog.server.conf.j2`
- [Service defaults](https://github.com/graylog2/graylog-ansible-role/blob/master/templates/graylog.server.default.j2): `templates/graylog.server.default.j2`
- [Service handlers](https://github.com/graylog2/graylog-ansible-role/blob/master/handlers/main.yml): `handlers/main.yml`

### Graylog dependencies

- **Graylog server**
- **Java runtime**
- **OpenSearch**
- **MongoDB**

### Other components

- **Playbook operator**
- **Linux host**

## Connections

- Playbook operator → Role entry: invokes role (evidence: `README.md`)
- Role entry → OS setup: selects setup
- Role entry → Graylog setup: configures server
- OS setup → Linux host: prepares host
- Red Hat setup → Linux host: prepares host
- Graylog setup → Graylog server: installs Graylog (evidence: `README.md`)
- Graylog setup → Server config: uses template
- Graylog setup → Service defaults: uses template
- Graylog setup → Service handlers: notifies service
- Graylog setup → Role defaults: reads settings
- Graylog setup → Role variables: reads settings
- OS setup → Debian variables: loads variables
- Red Hat setup → Red Hat variables: loads variables
- Graylog server → Java runtime: requires runtime (evidence: `README.md`)
- Graylog server → OpenSearch: depends on (evidence: `README.md`)
- Graylog server → MongoDB: depends on (evidence: `README.md`)
