Skip to content

Commit

Permalink
Enhance conditionals to avoid failure from graylog_full_version being…
Browse files Browse the repository at this point in the history
… defined without a value.
  • Loading branch information
etgraylog committed Jan 9, 2025
1 parent 7623926 commit c787398
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions tasks/setup-Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@

- 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 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_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 defined %}={{ graylog_full_version }}{% endif %}"
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"
Expand All @@ -54,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 | 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 | 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 | bool == true and graylog_version is version('5.0', '<'))
notify: restart graylog-server
12 changes: 6 additions & 6 deletions tasks/setup-RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +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 }}"
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 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_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 defined %}-{{ graylog_full_version }}{% endif %}"
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 | 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 | 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 | bool == true and graylog_version is version('5.0', '<'))
notify: restart graylog-server

0 comments on commit c787398

Please sign in to comment.