Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 4.0.0 #200

Merged
merged 33 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
caf9900
Remove implementation of obsolete ansible role elastic.elasticsearch.
etgraylog Feb 13, 2025
0b5ba64
Remove deprecated MongoDB install/config functionality.
etgraylog Feb 13, 2025
2dbd73b
Remove deprecated variable for nginx install/config.
etgraylog Feb 13, 2025
cb5e282
ansible-lint: refactored ansible module instances to include canonica…
etgraylog Feb 13, 2025
b0613ac
ansible-lint: refactored use of conditional statement 'when' to remov…
etgraylog Feb 13, 2025
cf6285e
ansible-lint: refactored use octal values with strings to preserve ex…
etgraylog Feb 13, 2025
e917b80
ansible-lint: Remove comments in playbooks.
etgraylog Feb 13, 2025
d044262
Remove implementation of obsolete ansible role elastic.elasticsearch.
etgraylog Feb 13, 2025
f86c0b2
Add task to create parent directory before child.
etgraylog Feb 13, 2025
a9c9c81
Update URLs to use https instead of insecure http.
etgraylog Feb 13, 2025
fb5af60
Remove empty line in Ansible Playbook header.
etgraylog Feb 13, 2025
9b70f7c
ansible-lint: fix jinja spacing issue at end of value.
etgraylog Feb 14, 2025
a20e8b8
ansible-lint: replace octal value with string so expected functionali…
etgraylog Feb 14, 2025
2b589a4
ansible-lint: add fully qualified canonical names (fqcn) to handlers/…
etgraylog Feb 14, 2025
201608a
galaxy_info namespace value must be all lowercase now (per ansible mo…
etgraylog Feb 14, 2025
7fc0552
galaxy_info min_ansible_version bumped from 2.13.13 to 2.18.2 in main…
etgraylog Feb 14, 2025
0cf86da
Updated pinned python modules
etgraylog Feb 14, 2025
4b0c933
Attempt to fix ansible-lint OSError Errno 63 file name too long error.
etgraylog Feb 14, 2025
662b519
Add requirements noted by newer ansible-lint for use.
etgraylog Feb 14, 2025
6d3d6c0
Update ansible molecule ci scenario to bump python from 3.9 to 3.12.
etgraylog Feb 14, 2025
2b3797d
Revise platforms section of ci molecule yaml file.
etgraylog Feb 14, 2025
fb27b87
ansible-lint: fix missing starting space in comment.
etgraylog Feb 14, 2025
c3ddd47
Another attempt to fix ansible molecule ci scenario.
etgraylog Feb 14, 2025
9d26c8e
ansible-lint: add missing starting space in comment.
etgraylog Feb 14, 2025
06940fa
Another attempt to fix ansible molecule scenario ci.
etgraylog Feb 14, 2025
245c4e8
Another attempt to fix ansible molecule scenario ci.
etgraylog Feb 14, 2025
245d378
ansible molecule scenario ci: remove v in version of ansible galaxy-r…
etgraylog Feb 14, 2025
aaeafd0
ansible molecule scenario ci: fix vars so we actually attempt to inst…
etgraylog Feb 14, 2025
223c03d
ansible molecule scenario ci: move role lean_delivery.java to galaxy-…
etgraylog Feb 14, 2025
ec49194
ansible molecule scenario ci: put role lean_delivery.java back to whe…
etgraylog Feb 14, 2025
ee80d03
molecule/ci/tests/test_default.py: remove deprecated features
etgraylog Feb 14, 2025
709f96d
ansible molecule ci scenario: match package-name with test_default.py…
etgraylog Feb 14, 2025
cba690b
Test ubuntu 24.04
etgraylog Feb 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .ansible-lint
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
exclude_paths:
- ./venv/
- ../../.ansible/roles/
- .ansible/roles/graylog2.graylog/
- .ansible/roles/lean_delivery.java
parseable: true
quiet: true
skip_list:
Expand Down
26 changes: 15 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
with:
path: 'graylog2.graylog-ansible-role'

- name: Set up Python 3.9
- name: Set up Python 3.12
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.12'

- name: Install test dependencies.
run: pip3 install yamllint
Expand All @@ -35,11 +35,12 @@ jobs:
strategy:
matrix:
distro:
#- centos7
#- centos8
#- ubuntu1804
#- ubuntu2004
- ubuntu2204
# - centos7
# - centos8
# - ubuntu1804
# - ubuntu2004
# - ubuntu2204
- ubuntu2404

steps:
- name: Check out the codebase.
Expand All @@ -50,17 +51,20 @@ jobs:
- name: Set up Python 3.
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.12'

- name: Install test dependencies.
- name: Install python dependencies.
run: pip3 install -r requirements.txt

- name: Install ansible dependencies.
run: ansible-galaxy role install lean_delivery.java,7.1.0

- name: Run Molecule tests.
run: molecule test --scenario-name=ci
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
#GRAYLOG_VERSION: 4.2.1
# GRAYLOG_VERSION: 4.2.1
GRAYLOG_VERSION: 5.2.12
GRAYLOG_REVISION: 1
MOLECULE_DISTRO: ${{ matrix.distro }}
Expand All @@ -76,4 +80,4 @@ jobs:
- name: Install Ansible.
run: sudo apt-get install -y ansible
- name: Install Role
run: ansible-galaxy install graylog2.graylog
run: ansible-galaxy role install graylog2.graylog
8 changes: 6 additions & 2 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ rules:
commas:
max-spaces-after: -1
level: error
comments: disable
comments:
min-spaces-from-content: 1 # Ensure at least 1 space between `#` and content
comments-indentation: disable
document-start: disable
empty-lines:
Expand All @@ -29,9 +30,12 @@ rules:
new-line-at-end-of-file: disable
new-lines:
type: unix
octal-values:
forbid-implicit-octal: true # Enforce explicit octal format
forbid-explicit-octal: true # Prevent octal values altogether
trailing-spaces: disable
truthy: disable

ignore: |
.github/stale.yml
venv/
venv/
23 changes: 4 additions & 19 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# Requirements
graylog_java_ppa: "ppa:webupd8team/java"
graylog_java_repo: "deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
graylog_java_src_repo: "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
graylog_java_repo: "deb https://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
graylog_java_src_repo: "deb-src https://ppa.launchpad.net/webupd8team/java/ubuntu xenial main"
graylog_java_repo_keyserver: "keyserver.ubuntu.com"
graylog_java_repo_key: "EEA14886"

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

# General
graylog_is_master: True
Expand Down Expand Up @@ -133,20 +132,9 @@ graylog_outputbuffer_processor_threads_core_pool_size: 3
graylog_outputbuffer_processor_threads_max_pool_size: 30

# MongoDB
graylog_mongodb_version: 4.4
graylog_mongodb_ubuntu_repo: "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu {{ ansible_distribution_release }}/mongodb-org/{{ graylog_mongodb_version }} multiverse"
graylog_mongodb_ubuntu_key: "https://www.mongodb.org/static/pgp/server-{{ graylog_mongodb_version }}.asc"
graylog_mongodb_debian_repo: "deb http://repo.mongodb.org/apt/debian {{ ansible_distribution_release }}/mongodb-org/{{ graylog_mongodb_version }} main"
graylog_mongodb_debian_key: "https://www.mongodb.org/static/pgp/server-{{ graylog_mongodb_version }}.asc"
graylog_mongodb_redhat_repo: "https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/{{ graylog_mongodb_version }}/x86_64/"
graylog_mongodb_redhat_key: "https://www.mongodb.org/static/pgp/server-{{ graylog_mongodb_version }}.asc"
graylog_mongodb_uri: "mongodb://127.0.0.1:27017/graylog"
graylog_mongodb_max_connections: 100
graylog_mongodb_threads_allowed_to_block_multiplier: 5
graylog_mongodb_package_name: mongodb-org
graylog_mongodb_service_name: mongod
graylog_mongodb_bind_ip: "127.0.0.1"
graylog_mongodb_bind_port: "27017"

# Drools
graylog_rules_file: ""
Expand Down Expand Up @@ -189,15 +177,12 @@ graylog_gc_warning_threshold: "1s"
graylog_server_heap_size: "1500m"
graylog_server_java: "/usr/bin/java" # For usage of the bundled openjdk version within graylog leave varviable blank
graylog_server_java_opts_extra: ""
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}}"
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 }}"
graylog_server_args: ""
graylog_server_wrapper: ""

# Install Switches
graylog_install_elasticsearch: True
graylog_install_mongodb: True
graylog_install_nginx: False #Deprecated
graylog_install_java: True
graylog_install_java: False

# Disable steps which break tests
graylog_not_testing: True
Expand Down
7 changes: 3 additions & 4 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
---

- name: "reload systemd configuration"
systemd:
ansible.builtin.systemd:
daemon_reload: yes

- name: "restart graylog-server"
service:
ansible.builtin.service:
name: "graylog-server"
state: "restarted"
enabled: "yes"

- name: "restart mongod"
service:
ansible.builtin.service:
name: "{{ graylog_mongodb_service_name }}"
state: "restarted"
enabled: "yes"
10 changes: 2 additions & 8 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,13 @@ dependencies:
version: 7.1.0
when: graylog_install_java

- role: "elastic.elasticsearch"
src: https://github.com/elastic/ansible-elasticsearch.git
version: main
scm: git
when: graylog_install_elasticsearch

galaxy_info:
role_name: graylog
namespace: Graylog2
namespace: graylog2
author: "Marius Sturm"
company: "Graylog, Inc."
description: "Install and configure Graylog log management."
min_ansible_version: "2.13.13"
min_ansible_version: "2.18.2"
license: "Apache 2"
platforms:
- name: "EL"
Expand Down
29 changes: 8 additions & 21 deletions molecule/ci/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
apt:
update_cache: yes
pkg:
- "openjdk-8-jre"
- "openjdk-17-jre"
- "gpg-agent"
- "curl"
state: "latest"
Expand All @@ -18,43 +18,30 @@
apt:
update_cache: yes
pkg:
- "openjdk-11-jre"
- "openjdk-17-jre"
- "gpg-agent"
- "curl"
state: "latest"
when: ansible_distribution == 'Debian'
- name: Install packages (Centos/Redhat)
yum:
name:
- java-1.8.0-openjdk
- java-1.17.0-openjdk
state: latest
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'

- hosts: "all"
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: 4.2
# Graylog vars
graylog_version: 6.1
graylog_install_java: False
graylog_install_enterprise_plugins: True
graylog_install_integrations_plugins: True
graylog_install_enterprise_integrations_plugins: True
graylog_install_open_package: True
graylog_install_enterprise_package: False
graylog_not_testing: False
graylog_password_secret: "2jueVqZpwLLjaWxV"
graylog_root_password_sha2: "8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918"
graylog_http_bind_address: "{{ ansible_default_ipv4.address }}:9000"
Expand Down
15 changes: 8 additions & 7 deletions molecule/ci/molecule.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
---
dependency:
name: galaxy
options:
role-file: requirements.yml
ignore-errors: true
driver:
name: docker
platforms:
- name: graylog
image: geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2004}-ansible
command: '/sbin/init'
image: geerlingguy/docker-${MOLECULE_DISTRO:-ubuntu2204}-ansible
pre_build_image: true
command: ""
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
networks:
- name: "graylog"
network_mode: "graylog"
- /sys/fs/cgroup:/sys/fs/cgroup:rw
published_ports:
- "0.0.0.0:9000:9000/tcp"
privileged: true
pre_build_image: true
cgroupns_mode: host
provisioner:
name: ansible
verifier:
Expand Down
52 changes: 1 addition & 51 deletions molecule/ci/tests/test_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,6 @@
from selenium.common.exceptions import TimeoutException
from selenium.common.exceptions import NoSuchElementException

def test_service_elasticsearch_running(host):
print("\nEnsure Elasticsearch is running...")
assert host.service("elasticsearch").is_running is True

def test_service_mongodb_running(host):
print("Ensure MongoDB is running...")
mongodb_service_name = 'mongod'
assert host.service(mongodb_service_name).is_running is True

def test_is_graylog_installed(host):
print("Ensure graylog-server package is installed...")
assert host.package('graylog-server').is_installed

def test_service_graylog_running(host):
print("Ensure graylog-server service is running...")
assert host.service("graylog-server").is_running is True

def test_service_graylog_started(host):
print("Waiting for Graylog to start up...")
end_time = time.time() + 90
server_up = 1

while server_up != 0 and time.time() < end_time:
time.sleep(2)
server_up = host.run_test("cat /var/log/graylog-server/server.log | grep 'Graylog server up and running.'").exit_status

assert server_up == 0

def test_service_graylog_plugins_loaded(host):
print("Checking if plugins loaded...")
results = host.run_test('curl -u admin:admin http://' + host.interface('eth0').addresses[0] + ':9000/api/system/plugins')
plugins = json.loads(results.stdout)

enterprise_plugin_loaded = False
integrations_plugin_loaded = False
enterprise_integrations_plugin_loaded = False

for plugin in plugins['plugins']:
if plugin['name'] == 'Graylog Enterprise':
enterprise_plugin_loaded = True
assert os.environ['GRAYLOG_VERSION'] in plugin['version']

if plugin['name'] == 'Integrations':
integrations_plugin_loaded = True
assert os.environ['GRAYLOG_VERSION'] in plugin['version']

if plugin['name'] == 'Graylog Enterprise':
enterprise_integrations_plugin_loaded = True
assert os.environ['GRAYLOG_VERSION'] in plugin['version']

assert enterprise_plugin_loaded is True
assert integrations_plugin_loaded is True
assert enterprise_integrations_plugin_loaded is True
assert host.package('graylog-server').is_installed
27 changes: 2 additions & 25 deletions molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
- name: Converge
hosts: all
vars:
#Graylog
graylog_install_elasticsearch: True
# Graylog
graylog_install_mongodb: True
graylog_install_java: False
graylog_not_testing: False
Expand All @@ -16,29 +15,7 @@
graylog_http_publish_uri: "http://{{ hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}:9000/"
graylog_http_external_uri: "http://localhost:9000/"

#Elasticsearch
es_major_version: "6.x"
es_version: "6.8.10"
es_instance_name: "graylog"
es_scripts: False
es_templates: False
es_version_lock: False
es_heap_size: "1g"
es_java_install: True
update_java: True
oss_version: True

es_config:
node.name: "graylog"
cluster.name: "graylog"
http.port: 9200
transport.tcp.port: 9300
network.host: "0.0.0.0"
node.data: True
node.master: True


#Plugins
# Plugins
graylog_install_enterprise_plugins: True
graylog_install_integrations_plugins: True
graylog_install_enterprise_integrations_plugins: True
Expand Down
1 change: 0 additions & 1 deletion molecule/default/roles/graylog-ansible-role

This file was deleted.

Loading