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

Pr 195 #197

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
9 changes: 6 additions & 3 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.
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: '3.9'

- name: Install test dependencies.
run: pip3 install yamllint
Expand Down Expand Up @@ -49,11 +49,14 @@ jobs:
- name: Set up Python 3.
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: '3.9'

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

- name: Install ansible 4.2.0 to work-around packaging issue (issue-2904)
run: pip3 install --force 'ansible==4.2.0'

- name: Run Molecule tests.
run: molecule test --scenario-name=ci
env:
Expand Down
12 changes: 10 additions & 2 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ graylog_web_thread_pool_size: 16
# JVM
graylog_gc_warning_threshold: "1s"
graylog_server_heap_size: "1500m"
graylog_server_java: "/usr/bin/java"
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_args: ""
Expand All @@ -202,11 +202,19 @@ graylog_install_java: True
# Disable steps which break tests
graylog_not_testing: True

# Plugins
# Plugins for Graylog Versions <5.0
graylog_install_enterprise_plugins: False
graylog_install_integrations_plugins: False
graylog_install_enterprise_integrations_plugins: False

# package version for Graylog Version >=5.0
graylog_install_enterprise_package: False
graylog_install_open_package: True

# Graylog Version to install
graylog_version: 5.0
graylog_full_version: ""

graylog_additional_config: {}

required_vars:
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ molecule-docker==1.0.2
molecule-vagrant==0.6
python-vagrant==0.5.15
pytest-testinfra==6.1.0
PyYAML==5.3.1
selenium==3.141.0
yamllint==1.25.0
webdriver-manager
Expand Down
29 changes: 22 additions & 7 deletions tasks/setup-Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,23 @@

- name: "Graylog server package should be installed"
apt:
name: "graylog-server{% if graylog_full_version is defined %}={{ graylog_full_version }}{% endif %}"
name: "graylog-server{% if graylog_full_version is not none and graylog_full_version | length > 1 %}={{ graylog_full_version }}{% endif %}"
state: "{{ graylog_package_state }}"
when: graylog_version is version('5.0', '<')
notify: "restart graylog-server"

- name: "Graylog Open server package should be installed"
apt:
name: "graylog-server{% if graylog_full_version is not none and graylog_full_version | length > 1 %}={{ graylog_full_version }}{% endif %}"
state: "{{ graylog_package_state }}"
when: (graylog_install_open_package | bool == true and graylog_install_enterprise_package | bool == false and graylog_version is version('5.0', '>='))
notify: "restart graylog-server"

- name: "Graylog Enterprise server package should be installed"
apt:
name: "graylog-enterprise{% if graylog_full_version is not none and graylog_full_version | length > 1 %}={{ graylog_full_version }}{% endif %}"
state: "{{ graylog_package_state }}"
when: (graylog_install_open_package | bool == false and graylog_install_enterprise_package | bool == true and graylog_version is version('5.0', '>='))
notify: "restart graylog-server"

- name: "setup-Debian.yml | Set elasticsearch priority to {{ graylog_es_debian_pin_version }} apt_preferences"
Expand All @@ -39,21 +54,21 @@

- name: "Installing graylog-enterprise-plugins"
apt:
name: "graylog-enterprise-plugins{% if graylog_full_version is defined %}={{ graylog_full_version }}{% endif %}"
name: "graylog-enterprise-plugins{% if graylog_full_version is not none and graylog_full_version | length > 1 %}={{ graylog_full_version }}{% endif %}"
state: "{{ graylog_package_state }}"
when: graylog_install_enterprise_plugins
when: (graylog_install_enterprise_plugins | bool == true and graylog_version is version('5.0', '<'))
notify: restart graylog-server

- name: "Installing graylog-integrations-plugins"
apt:
name: "graylog-integrations-plugins{% if graylog_full_version is defined %}={{ graylog_full_version }}{% endif %}"
name: "graylog-integrations-plugins{% if graylog_full_version is not none and graylog_full_version | length > 1 %}={{ graylog_full_version }}{% endif %}"
state: "{{ graylog_package_state }}"
when: graylog_install_integrations_plugins
when: (graylog_install_integrations_plugins | bool == true and graylog_version is version('5.0', '<'))
notify: restart graylog-server

- name: "Installing graylog-enterprise-integrations-plugins"
apt:
name: "graylog-enterprise-integrations-plugins{% if graylog_full_version is defined %}={{ graylog_full_version }}{% endif %}"
name: "graylog-enterprise-integrations-plugins{% if graylog_full_version is not none and graylog_full_version | length > 1 %}={{ graylog_full_version }}{% endif %}"
state: "{{ graylog_package_state }}"
when: graylog_install_enterprise_integrations_plugins
when: (graylog_install_enterprise_integrations_plugins | bool == true and graylog_version is version('5.0', '<'))
notify: restart graylog-server
31 changes: 23 additions & 8 deletions tasks/setup-RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,42 @@

- name: "Graylog server should be installed"
yum:
name: "graylog-server{% if graylog_full_version is defined %}-{{ graylog_full_version }}{% endif %}"
name: "graylog-server{% if graylog_full_version is not none and graylog_full_version | length > 1 %}-{{ graylog_full_version }}{% endif %}"
state: "{{ graylog_package_state }}"
notify: restart graylog-server
when: graylog_version is version('5.0', '<')
notify: "restart graylog-server"

- name: "Graylog Open server package should be installed"
yum:
name: "graylog-server{% if graylog_full_version is not none and graylog_full_version | length > 1 %}-{{ graylog_full_version }}{% endif %}"
state: "{{ graylog_package_state }}"
when: (graylog_install_open_package | bool == true and graylog_install_enterprise_package | bool == false and graylog_version is version('5.0', '>='))
notify: "restart graylog-server"

- name: "Graylog Enterprise server package should be installed"
yum:
name: "graylog-enterprise{% if graylog_full_version is not none and graylog_full_version | length > 1 %}-{{ graylog_full_version }}{% endif %}"
state: "{{ graylog_package_state }}"
when: (graylog_install_open_package | bool == false and graylog_install_enterprise_package | bool == true and graylog_version is version('5.0', '>='))
notify: "restart graylog-server"

- name: "Installing graylog-enterprise-plugins"
yum:
name: "graylog-enterprise-plugins{% if graylog_full_version is defined %}-{{ graylog_full_version }}{% endif %}"
name: "graylog-enterprise-plugins{% if graylog_full_version is not none and graylog_full_version | length > 1 %}-{{ graylog_full_version }}{% endif %}"
state: "{{ graylog_package_state }}"
when: graylog_install_enterprise_plugins
when: (graylog_install_enterprise_plugins | bool == true and graylog_version is version('5.0', '<'))
notify: restart graylog-server

- name: "Installing graylog-integrations-plugins"
yum:
name: "graylog-integrations-plugins{% if graylog_full_version is defined %}-{{ graylog_full_version }}{% endif %}"
name: "graylog-integrations-plugins{% if graylog_full_version is not none and graylog_full_version | length > 1 %}-{{ graylog_full_version }}{% endif %}"
state: "{{ graylog_package_state }}"
when: graylog_install_integrations_plugins
when: (graylog_install_integrations_plugins | bool == true and graylog_version is version('5.0', '<'))
notify: restart graylog-server

- name: "Installing graylog-enterprise-integrations-plugins"
yum:
name: "graylog-enterprise-integrations-plugins{% if graylog_full_version is defined %}-{{ graylog_full_version }}{% endif %}"
name: "graylog-enterprise-integrations-plugins{% if graylog_full_version is not none and graylog_full_version | length > 1 %}-{{ graylog_full_version }}{% endif %}"
state: "{{ graylog_package_state }}"
when: graylog_install_enterprise_integrations_plugins
when: (graylog_install_enterprise_integrations_plugins | bool == true and graylog_version is version('5.0', '<'))
notify: restart graylog-server
2 changes: 2 additions & 0 deletions templates/graylog.server.default.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{% if graylog_server_java is defined and graylog_server_java|length %}
JAVA="{{ graylog_server_java }}"
{% endif %}
GRAYLOG_SERVER_JAVA_OPTS="{{ graylog_server_java_opts }}"
GRAYLOG_SERVER_ARGS="{{ graylog_server_args }}"
GRAYLOG_COMMAND_WRAPPER="{{ graylog_server_wrapper }}"
Loading