feat: Add graylog
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: Create directory for docker-compose
|
||||
ansible.builtin.file:
|
||||
path: /root/docker/
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Copy .env file
|
||||
template:
|
||||
src: ".env"
|
||||
dest: /root/docker/.env
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
|
||||
- name: Copy docker-compose file
|
||||
template:
|
||||
src: "docker-compose.yml"
|
||||
dest: /root/docker/docker-compose.yml
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
|
||||
- name: Run docker-compose
|
||||
ansible.builtin.shell:
|
||||
args:
|
||||
cmd: docker compose up -d
|
||||
chdir: /root/docker/
|
||||
@@ -0,0 +1,14 @@
|
||||
# You MUST set a secret to secure/pepper the stored user passwords here. Use at least 64 characters.
|
||||
# Generate one by using for example: pwgen -N 1 -s 96
|
||||
# ATTENTION: This value must be the same on all Graylog nodes in the cluster.
|
||||
# Changing this value after installation will render all user sessions and encrypted values in the database invalid. (e.g. encrypted access tokens)
|
||||
GRAYLOG_PASSWORD_SECRET={{ graylog_password_secret }}
|
||||
|
||||
# You MUST specify a hash password for the root user (which you only need to initially set up the
|
||||
# system and in case you lose connectivity to your authentication backend)
|
||||
# This password cannot be changed using the API or via the web interface. If you need to change it,
|
||||
# modify it in this file.
|
||||
# Create one by using for example: echo -n yourpassword | shasum -a 256
|
||||
# and put the resulting hash value into the following line
|
||||
# CHANGE THIS!
|
||||
GRAYLOG_ROOT_PASSWORD_SHA2={{ graylog_root_password }}
|
||||
@@ -0,0 +1,64 @@
|
||||
services:
|
||||
mongodb:
|
||||
image: "mongo:5.0"
|
||||
volumes:
|
||||
- "/data/mongodb:/data/db"
|
||||
restart: "on-failure"
|
||||
|
||||
# For DataNode setup, graylog starts with a preflight UI, this is a change from just using OpenSearch/Elasticsearch.
|
||||
# Please take a look at the README at the top of this repo or the regular docs for more info.
|
||||
datanode:
|
||||
image: "${DATANODE_IMAGE:-graylog/graylog-datanode:6.1}"
|
||||
hostname: "datanode"
|
||||
environment:
|
||||
GRAYLOG_DATANODE_NODE_ID_FILE: "/var/lib/graylog-datanode/node-id"
|
||||
# GRAYLOG_DATANODE_PASSWORD_SECRET and GRAYLOG_PASSWORD_SECRET MUST be the same value
|
||||
GRAYLOG_DATANODE_PASSWORD_SECRET: "${GRAYLOG_PASSWORD_SECRET}"
|
||||
GRAYLOG_DATANODE_MONGODB_URI: "mongodb://mongodb:27017/graylog"
|
||||
ulimits:
|
||||
memlock:
|
||||
hard: -1
|
||||
soft: -1
|
||||
nofile:
|
||||
soft: 65536
|
||||
hard: 65536
|
||||
ports:
|
||||
- "8999:8999/tcp" # DataNode API
|
||||
- "9200:9200/tcp"
|
||||
- "9300:9300/tcp"
|
||||
volumes:
|
||||
- "/data/datanode:/var/lib/graylog-datanode"
|
||||
restart: "on-failure"
|
||||
|
||||
graylog:
|
||||
hostname: "server"
|
||||
image: "${GRAYLOG_IMAGE:-graylog/graylog:6.1}"
|
||||
depends_on:
|
||||
mongodb:
|
||||
condition: "service_started"
|
||||
entrypoint: "/usr/bin/tini -- /docker-entrypoint.sh"
|
||||
environment:
|
||||
GRAYLOG_NODE_ID_FILE: "/usr/share/graylog/data/data/node-id"
|
||||
# GRAYLOG_DATANODE_PASSWORD_SECRET and GRAYLOG_PASSWORD_SECRET MUST be the same value
|
||||
GRAYLOG_PASSWORD_SECRET: "${GRAYLOG_PASSWORD_SECRET}"
|
||||
GRAYLOG_ROOT_PASSWORD_SHA2: "${GRAYLOG_ROOT_PASSWORD_SHA2}"
|
||||
GRAYLOG_HTTP_BIND_ADDRESS: "0.0.0.0:9000"
|
||||
GRAYLOG_HTTP_EXTERNAL_URI: "https://graylog.lino.cooking/"
|
||||
GRAYLOG_MONGODB_URI: "mongodb://mongodb:27017/graylog"
|
||||
ports:
|
||||
- "5044:5044/tcp" # Beats
|
||||
- "5140:5140/udp" # Syslog
|
||||
- "5140:5140/tcp" # Syslog
|
||||
- "5555:5555/tcp" # RAW TCP
|
||||
- "5555:5555/udp" # RAW UDP
|
||||
- "9000:9000/tcp" # Server API
|
||||
- "12201:12201/tcp" # GELF TCP
|
||||
- "12201:12201/udp" # GELF UDP
|
||||
#- "10000:10000/tcp" # Custom TCP port
|
||||
#- "10000:10000/udp" # Custom UDP port
|
||||
- "13301:13301/tcp" # Forwarder data
|
||||
- "13302:13302/tcp" # Forwarder config
|
||||
volumes:
|
||||
- "/data/data:/usr/share/graylog/data/data"
|
||||
- "/data/journal:/usr/share/graylog/data/journal"
|
||||
restart: "on-failure"
|
||||
Reference in New Issue
Block a user