Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/graylog2/graylog-ansible-role
Ansible role which installs and configures Graylog
https://github.com/graylog2/graylog-ansible-role
ansible ansible-galaxy ansible-playbook ansible-role graylog log-analysis log-management logging playbook
Last synced: 1 day ago
JSON representation
Ansible role which installs and configures Graylog
- Host: GitHub
- URL: https://github.com/graylog2/graylog-ansible-role
- Owner: Graylog2
- License: apache-2.0
- Created: 2014-08-27T16:46:48.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2025-01-13T07:44:13.000Z (8 days ago)
- Last Synced: 2025-01-19T20:13:44.124Z (1 day ago)
- Topics: ansible, ansible-galaxy, ansible-playbook, ansible-role, graylog, log-analysis, log-management, logging, playbook
- Language: Jinja
- Homepage:
- Size: 392 KB
- Stars: 213
- Watchers: 35
- Forks: 126
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Galaxy](https://img.shields.io/badge/galaxy-graylog--ansible--role-blue)](https://galaxy.ansible.com/Graylog2/graylog) [![CI](https://github.com/Graylog2/graylog-ansible-role/actions/workflows/ci.yml/badge.svg)](https://github.com/Graylog2/graylog-ansible-role/actions/workflows/ci.yml) ![Ansible](https://img.shields.io/ansible/role/d/56392.svg) ![Ansible](https://img.shields.io/badge/dynamic/json.svg?label=min_ansible_version&url=https%3A%2F%2Fgalaxy.ansible.com%2Fapi%2Fv1%2Froles%2F56392%2F&query=$.min_ansible_version) ![Ansible](https://img.shields.io/ansible/quality/56392)
# Graylog Ansible Role
## Requirements
- Ansible (2.13.13)
- Python 3.9
- At least 4gb of memory on the target instance.
- Linux
- Currently tested against:
- Ubuntu 18.04
- Ubuntu 20.04
- Ubuntu 22.04
- Centos 7
- Centos 8
- Centos 9To install the role, run:
ansible-galaxy install graylog2.graylog
## Dependencies
Graylog has the following dependencies:
- Java
- [Elasticsearch](https://github.com/elastic/ansible-elasticsearch)
- MongoDBSee the official [Graylog documentation](https://docs.graylog.org/docs/installing) for more details on these requirements.
Be certain you are running a supported version of Elasticsearch. You can configure what version of Elasticsearch Ansible will install with the `es_version` variable. Running Graylog against an unsupported version of Elasticsearch can break your instance!
**Compatibility Matrix**
| Graylog version | 3.x | 4.x | 5.x | 6.x |
|:--------------|:-------------:|:----------:|:-------------:|:-------------:|
| Elasticsearch | 5-6 | 6.8 - 7.10 | 6.8 - 7.10 | n/a |
| OpenSearch | | 1.x* | 1.x - 2.x | 1.x - 2.x |
*Graylog 4.3.x introduces support for OpenSearch.Refer to the [Software Interoperability Chart](https://go2docs.graylog.org/5-0/planning_your_deployment/planning_your_upgrade_to_opensearch.htm)
You will need to these Ansible role dependencies:
- [Java](https://github.com/lean-delivery/ansible-role-java)
- [Elasticsearch](https://github.com/elastic/ansible-elasticsearch).To install them, run:
ansible-galaxy install -r /requirements.yml
## Example Playbook
Here is an example playbook that uses this role. This is a single-instance configuration. It installs Java, MongoDB, Elasticsearch, and Graylog onto the same server.
```yaml
- hosts: "all"
remote_user: "ubuntu"
become: True
vars:
#Elasticsearch vars
es_major_version: "7.x"
es_version: "7.10.2"
es_enable_xpack: False
es_instance_name: "graylog"
es_heap_size: "1g"
es_config:
node.name: "graylog"
cluster.name: "graylog"
http.port: 9200
transport.tcp.port: 9300
network.host: "127.0.0.1"
discovery.seed_hosts: "localhost:9300"
cluster.initial_master_nodes: "graylog"
oss_version: True
es_action_auto_create_index: False#Graylog vars
graylog_version: 5.2
graylog_install_java: True
graylog_password_secret: "" # Insert your own here. Generate with: pwgen -s 96 1
graylog_root_password_sha2: "" # Insert your own root_password_sha2 here.
graylog_http_bind_address: "{{ ansible_default_ipv4.address }}:9000"
graylog_http_publish_uri: "http://{{ ansible_default_ipv4.address }}:9000/"
graylog_http_external_uri: "http://{{ ansible_default_ipv4.address }}:9000/"
graylog_install_open_package: True
graylog_install_enterprise_package: Falseroles:
- role: "graylog2.graylog"
tags:
- "graylog"
```Remember to generate a unique `password_secret` and `root_password_sha2` for your instance.
To generate `password_secret`:
pwgen -s 96 1
To generate `root_password_sha2`:
echo -n "Enter Password: " && head -1