Skip to content

Commit 1dc73e2

Browse files
authored
Merge pull request #200 from Graylog2/release-4-0-0
Release 4.0.0
2 parents 593990d + cba690b commit 1dc73e2

29 files changed

+205
-533
lines changed

.ansible-lint

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
exclude_paths:
22
- ./venv/
3-
- ../../.ansible/roles/
3+
- .ansible/roles/graylog2.graylog/
4+
- .ansible/roles/lean_delivery.java
45
parseable: true
56
quiet: true
67
skip_list:

.github/workflows/ci.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
with:
1818
path: 'graylog2.graylog-ansible-role'
1919

20-
- name: Set up Python 3.9
20+
- name: Set up Python 3.12
2121
uses: actions/setup-python@v2
2222
with:
23-
python-version: '3.9'
23+
python-version: '3.12'
2424

2525
- name: Install test dependencies.
2626
run: pip3 install yamllint
@@ -35,11 +35,12 @@ jobs:
3535
strategy:
3636
matrix:
3737
distro:
38-
#- centos7
39-
#- centos8
40-
#- ubuntu1804
41-
#- ubuntu2004
42-
- ubuntu2204
38+
# - centos7
39+
# - centos8
40+
# - ubuntu1804
41+
# - ubuntu2004
42+
# - ubuntu2204
43+
- ubuntu2404
4344

4445
steps:
4546
- name: Check out the codebase.
@@ -50,17 +51,20 @@ jobs:
5051
- name: Set up Python 3.
5152
uses: actions/setup-python@v2
5253
with:
53-
python-version: '3.9'
54+
python-version: '3.12'
5455

55-
- name: Install test dependencies.
56+
- name: Install python dependencies.
5657
run: pip3 install -r requirements.txt
5758

59+
- name: Install ansible dependencies.
60+
run: ansible-galaxy role install lean_delivery.java,7.1.0
61+
5862
- name: Run Molecule tests.
5963
run: molecule test --scenario-name=ci
6064
env:
6165
PY_COLORS: '1'
6266
ANSIBLE_FORCE_COLOR: '1'
63-
#GRAYLOG_VERSION: 4.2.1
67+
# GRAYLOG_VERSION: 4.2.1
6468
GRAYLOG_VERSION: 5.2.12
6569
GRAYLOG_REVISION: 1
6670
MOLECULE_DISTRO: ${{ matrix.distro }}
@@ -76,4 +80,4 @@ jobs:
7680
- name: Install Ansible.
7781
run: sudo apt-get install -y ansible
7882
- name: Install Role
79-
run: ansible-galaxy install graylog2.graylog
83+
run: ansible-galaxy role install graylog2.graylog

.yamllint

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ rules:
1515
commas:
1616
max-spaces-after: -1
1717
level: error
18-
comments: disable
18+
comments:
19+
min-spaces-from-content: 1 # Ensure at least 1 space between `#` and content
1920
comments-indentation: disable
2021
document-start: disable
2122
empty-lines:
@@ -29,9 +30,12 @@ rules:
2930
new-line-at-end-of-file: disable
3031
new-lines:
3132
type: unix
33+
octal-values:
34+
forbid-implicit-octal: true # Enforce explicit octal format
35+
forbid-explicit-octal: true # Prevent octal values altogether
3236
trailing-spaces: disable
3337
truthy: disable
3438

3539
ignore: |
3640
.github/stale.yml
37-
venv/
41+
venv/

defaults/main.yml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
# Requirements
44
graylog_java_ppa: "ppa:webupd8team/java"
5-
graylog_java_repo: "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
6-
graylog_java_src_repo: "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
5+
graylog_java_repo: "deb https://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
6+
graylog_java_src_repo: "deb-src https://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
77
graylog_java_repo_keyserver: "keyserver.ubuntu.com"
88
graylog_java_repo_key: "EEA14886"
99

@@ -12,7 +12,6 @@ graylog_apt_deb_url: "https://packages.graylog2.org/repo/packages/
1212
graylog_manage_apt_repo: True
1313
graylog_yum_rpm_url: "https://packages.graylog2.org/repo/packages/graylog-{{ graylog_version }}-repository_latest.rpm"
1414
graylog_manage_yum_repo: True
15-
graylog_es_debian_pin_version: "6.*"
1615

1716
# General
1817
graylog_is_master: True
@@ -133,20 +132,9 @@ graylog_outputbuffer_processor_threads_core_pool_size: 3
133132
graylog_outputbuffer_processor_threads_max_pool_size: 30
134133

135134
# MongoDB
136-
graylog_mongodb_version: 4.4
137-
graylog_mongodb_ubuntu_repo: "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/{{ graylog_mongodb_version }} multiverse"
138-
graylog_mongodb_ubuntu_key: "https://www.mongodb.org/static/pgp/server-{{ graylog_mongodb_version }}.asc"
139-
graylog_mongodb_debian_repo: "deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/{{ graylog_mongodb_version }} main"
140-
graylog_mongodb_debian_key: "https://www.mongodb.org/static/pgp/server-{{ graylog_mongodb_version }}.asc"
141-
graylog_mongodb_redhat_repo: "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/{{ graylog_mongodb_version }}/x86_64/"
142-
graylog_mongodb_redhat_key: "https://www.mongodb.org/static/pgp/server-{{ graylog_mongodb_version }}.asc"
143135
graylog_mongodb_uri: "mongodb://127.0.0.1:27017/graylog"
144136
graylog_mongodb_max_connections: 100
145137
graylog_mongodb_threads_allowed_to_block_multiplier: 5
146-
graylog_mongodb_package_name: mongodb-org
147-
graylog_mongodb_service_name: mongod
148-
graylog_mongodb_bind_ip: "127.0.0.1"
149-
graylog_mongodb_bind_port: "27017"
150138

151139
# Drools
152140
graylog_rules_file: ""
@@ -189,15 +177,12 @@ graylog_gc_warning_threshold: "1s"
189177
graylog_server_heap_size: "1500m"
190178
graylog_server_java: "/usr/bin/java" # For usage of the bundled openjdk version within graylog leave varviable blank
191179
graylog_server_java_opts_extra: ""
192-
graylog_server_java_opts: "-Djava.net.preferIPv4Stack=true -Xms{{ graylog_server_heap_size }} -Xmx{{ graylog_server_heap_size }} -XX:NewRatio=1 -server -XX:+ResizeTLAB -XX:-OmitStackTraceInFastThrow {{graylog_server_java_opts_extra}}"
180+
graylog_server_java_opts: "-Djava.net.preferIPv4Stack=true -Xms{{ graylog_server_heap_size }} -Xmx{{ graylog_server_heap_size }} -XX:NewRatio=1 -server -XX:+ResizeTLAB -XX:-OmitStackTraceInFastThrow {{ graylog_server_java_opts_extra }}"
193181
graylog_server_args: ""
194182
graylog_server_wrapper: ""
195183

196184
# Install Switches
197-
graylog_install_elasticsearch: True
198-
graylog_install_mongodb: True
199-
graylog_install_nginx: False #Deprecated
200-
graylog_install_java: True
185+
graylog_install_java: False
201186

202187
# Disable steps which break tests
203188
graylog_not_testing: True

handlers/main.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
---
2-
32
- name: "reload systemd configuration"
4-
systemd:
3+
ansible.builtin.systemd:
54
daemon_reload: yes
65

76
- name: "restart graylog-server"
8-
service:
7+
ansible.builtin.service:
98
name: "graylog-server"
109
state: "restarted"
1110
enabled: "yes"
1211

1312
- name: "restart mongod"
14-
service:
13+
ansible.builtin.service:
1514
name: "{{ graylog_mongodb_service_name }}"
1615
state: "restarted"
1716
enabled: "yes"

meta/main.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,13 @@ dependencies:
55
version: 7.1.0
66
when: graylog_install_java
77

8-
- role: "elastic.elasticsearch"
9-
src: https://github.com/elastic/ansible-elasticsearch.git
10-
version: main
11-
scm: git
12-
when: graylog_install_elasticsearch
13-
148
galaxy_info:
159
role_name: graylog
16-
namespace: Graylog2
10+
namespace: graylog2
1711
author: "Marius Sturm"
1812
company: "Graylog, Inc."
1913
description: "Install and configure Graylog log management."
20-
min_ansible_version: "2.13.13"
14+
min_ansible_version: "2.18.2"
2115
license: "Apache 2"
2216
platforms:
2317
- name: "EL"

molecule/ci/converge.yml

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
apt:
1010
update_cache: yes
1111
pkg:
12-
- "openjdk-8-jre"
12+
- "openjdk-17-jre"
1313
- "gpg-agent"
1414
- "curl"
1515
state: "latest"
@@ -18,43 +18,30 @@
1818
apt:
1919
update_cache: yes
2020
pkg:
21-
- "openjdk-11-jre"
21+
- "openjdk-17-jre"
2222
- "gpg-agent"
2323
- "curl"
2424
state: "latest"
2525
when: ansible_distribution == 'Debian'
2626
- name: Install packages (Centos/Redhat)
2727
yum:
2828
name:
29-
- java-1.8.0-openjdk
29+
- java-1.17.0-openjdk
3030
state: latest
3131
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
3232

3333
- hosts: "all"
3434
vars:
35-
#Elasticsearch vars
36-
es_major_version: "7.x"
37-
es_version: "7.10.2"
38-
es_enable_xpack: False
39-
es_instance_name: "graylog"
40-
es_heap_size: "1g"
41-
es_config:
42-
node.name: "graylog"
43-
cluster.name: "graylog"
44-
http.port: 9200
45-
transport.tcp.port: 9300
46-
network.host: "127.0.0.1"
47-
discovery.seed_hosts: "localhost:9300"
48-
cluster.initial_master_nodes: "graylog"
49-
oss_version: True
50-
es_action_auto_create_index: False
5135

52-
#Graylog vars
53-
graylog_version: 4.2
36+
# Graylog vars
37+
graylog_version: 6.1
5438
graylog_install_java: False
5539
graylog_install_enterprise_plugins: True
5640
graylog_install_integrations_plugins: True
5741
graylog_install_enterprise_integrations_plugins: True
42+
graylog_install_open_package: True
43+
graylog_install_enterprise_package: False
44+
graylog_not_testing: False
5845
graylog_password_secret: "2jueVqZpwLLjaWxV"
5946
graylog_root_password_sha2: "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918"
6047
graylog_http_bind_address: "{{ ansible_default_ipv4.address }}:9000"

molecule/ci/molecule.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
---
22
dependency:
33
name: galaxy
4+
options:
5+
role-file: requirements.yml
6+
ignore-errors: true
47
driver:
58
name: docker
69
platforms:
710
- name: graylog
8-
image: geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible
9-
command: '/sbin/init'
11+
image: geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible
12+
pre_build_image: true
13+
command: ""
1014
volumes:
11-
- /sys/fs/cgroup:/sys/fs/cgroup:ro
12-
networks:
13-
- name: "graylog"
14-
network_mode: "graylog"
15+
- /sys/fs/cgroup:/sys/fs/cgroup:rw
1516
published_ports:
1617
- "0.0.0.0:9000:9000/tcp"
1718
privileged: true
18-
pre_build_image: true
19+
cgroupns_mode: host
1920
provisioner:
2021
name: ansible
2122
verifier:

molecule/ci/tests/test_default.py

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -10,56 +10,6 @@
1010
from selenium.common.exceptions import TimeoutException
1111
from selenium.common.exceptions import NoSuchElementException
1212

13-
def test_service_elasticsearch_running(host):
14-
print("\nEnsure Elasticsearch is running...")
15-
assert host.service("elasticsearch").is_running is True
16-
17-
def test_service_mongodb_running(host):
18-
print("Ensure MongoDB is running...")
19-
mongodb_service_name = 'mongod'
20-
assert host.service(mongodb_service_name).is_running is True
21-
2213
def test_is_graylog_installed(host):
2314
print("Ensure graylog-server package is installed...")
24-
assert host.package('graylog-server').is_installed
25-
26-
def test_service_graylog_running(host):
27-
print("Ensure graylog-server service is running...")
28-
assert host.service("graylog-server").is_running is True
29-
30-
def test_service_graylog_started(host):
31-
print("Waiting for Graylog to start up...")
32-
end_time = time.time() + 90
33-
server_up = 1
34-
35-
while server_up != 0 and time.time() < end_time:
36-
time.sleep(2)
37-
server_up = host.run_test("cat /var/log/graylog-server/server.log | grep 'Graylog server up and running.'").exit_status
38-
39-
assert server_up == 0
40-
41-
def test_service_graylog_plugins_loaded(host):
42-
print("Checking if plugins loaded...")
43-
results = host.run_test('curl -u admin:admin http://' + host.interface('eth0').addresses[0] + ':9000/api/system/plugins')
44-
plugins = json.loads(results.stdout)
45-
46-
enterprise_plugin_loaded = False
47-
integrations_plugin_loaded = False
48-
enterprise_integrations_plugin_loaded = False
49-
50-
for plugin in plugins['plugins']:
51-
if plugin['name'] == 'Graylog Enterprise':
52-
enterprise_plugin_loaded = True
53-
assert os.environ['GRAYLOG_VERSION'] in plugin['version']
54-
55-
if plugin['name'] == 'Integrations':
56-
integrations_plugin_loaded = True
57-
assert os.environ['GRAYLOG_VERSION'] in plugin['version']
58-
59-
if plugin['name'] == 'Graylog Enterprise':
60-
enterprise_integrations_plugin_loaded = True
61-
assert os.environ['GRAYLOG_VERSION'] in plugin['version']
62-
63-
assert enterprise_plugin_loaded is True
64-
assert integrations_plugin_loaded is True
65-
assert enterprise_integrations_plugin_loaded is True
15+
assert host.package('graylog-server').is_installed

molecule/default/converge.yml

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
- name: Converge
33
hosts: all
44
vars:
5-
#Graylog
6-
graylog_install_elasticsearch: True
5+
# Graylog
76
graylog_install_mongodb: True
87
graylog_install_java: False
98
graylog_not_testing: False
@@ -16,29 +15,7 @@
1615
graylog_http_publish_uri: "http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:9000/"
1716
graylog_http_external_uri: "http://localhost:9000/"
1817

19-
#Elasticsearch
20-
es_major_version: "6.x"
21-
es_version: "6.8.10"
22-
es_instance_name: "graylog"
23-
es_scripts: False
24-
es_templates: False
25-
es_version_lock: False
26-
es_heap_size: "1g"
27-
es_java_install: True
28-
update_java: True
29-
oss_version: True
30-
31-
es_config:
32-
node.name: "graylog"
33-
cluster.name: "graylog"
34-
http.port: 9200
35-
transport.tcp.port: 9300
36-
network.host: "0.0.0.0"
37-
node.data: True
38-
node.master: True
39-
40-
41-
#Plugins
18+
# Plugins
4219
graylog_install_enterprise_plugins: True
4320
graylog_install_integrations_plugins: True
4421
graylog_install_enterprise_integrations_plugins: True

0 commit comments

Comments
 (0)