Skip to content

Commit

Permalink
Enable skipping versions check
Browse files Browse the repository at this point in the history
These tables are incomplete, and a hinderance for deployments to valid
combinations. Allow the user to bypass this by supplying

  `-e enable_version_check=false`
  • Loading branch information
eb4x committed May 9, 2024
1 parent e00ab8e commit f6b6d42
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 35 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/1223-enable-version-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- Introduce flag `enable_version_check` to allow installations on non-supported platforms.
1 change: 1 addition & 0 deletions docs/ZABBIX_AGENT_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ See the following list of supported Operating systems with the Zabbix releases:
| Debian 11 bullseye | V | V | V |
| Debian 10 buster | V | V | V |

You can bypass this matrix by setting `enable_version_check: false`

# Getting started

Expand Down
2 changes: 2 additions & 0 deletions docs/ZABBIX_JAVAGATEWAY_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ See the following list of supported Operating systems with the Zabbix releases.
| Debian 11 bullseye | V | V | V |
| Debian 10 buster | V | V | V |

You can bypass this matrix by setting `enable_version_check: false`

# Role Variables

## Main variables
Expand Down
2 changes: 2 additions & 0 deletions docs/ZABBIX_PROXY_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ See the following list of supported Operating systems with the Zabbix releases.
| Debian 11 bullseye | V | V | V |
| Debian 10 buster | V | V | V |

You can bypass this matrix by setting `enable_version_check: false`

# Role Variables

## Main variables
Expand Down
2 changes: 2 additions & 0 deletions docs/ZABBIX_SERVER_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ See the following list of supported Operating systems with the Zabbix releases:
| Debian 11 bullseye | V | V | V |
| Debian 10 buster | | | V |

You can bypass this matrix by setting `enable_version_check: false`

# Installation

Installing this role is very simple: `ansible-galaxy install community.zabbix.zabbix_server`
Expand Down
2 changes: 2 additions & 0 deletions docs/ZABBIX_WEB_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ See the following list of supported Operating Systems with the Zabbix releases.
| Debian 11 bullseye | V | V | V |
| Debian 10 buster | | | V |

You can bypass this matrix by setting `enable_version_check: false`

# Installation

Installing this role is very simple: `ansible-galaxy install community.zabbix.zabbix_web`
Expand Down
16 changes: 6 additions & 10 deletions roles/zabbix_agent/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@
tags:
- always

- name: Set More Variables
ansible.builtin.set_fact:
zabbix_valid_version: "{{ zabbix_agent_version|float in zabbix_valid_agent_versions[ansible_distribution_major_version] }}"
tags:
- always

- name: Stopping Install of Invalid Version
ansible.builtin.fail:
msg: Zabbix version {{ zabbix_agent_version }} is not supported on {{ ansible_distribution }} {{ ansible_distribution_major_version }}
when: not zabbix_valid_version
- name: Check that version is supported
when: enable_version_check | default(true) | bool
ansible.builtin.assert:
that:
- "{{ zabbix_agent_version|float in zabbix_valid_agent_versions[ansible_distribution_major_version] }}"
fail_msg: Zabbix version {{ zabbix_agent_version }} is not supported on {{ ansible_distribution }} {{ ansible_distribution_major_version }}
tags:
- always

Expand Down
16 changes: 6 additions & 10 deletions roles/zabbix_javagateway/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@
tags:
- always

- name: Set More Variables
ansible.builtin.set_fact:
zabbix_valid_version: "{{ zabbix_javagateway_version|float in zabbix_valid_javagateway_versions[ansible_distribution_major_version] }}"
tags:
- always

- name: Stopping Install of Invalid Version
ansible.builtin.fail:
msg: Zabbix version {{ zabbix_javagateway_version }} is not supported on {{ ansible_distribution }} {{ ansible_distribution_major_version }}
when: not zabbix_valid_version
- name: Check that version is supported
when: enable_version_check | default(true) | bool
ansible.builtin.assert:
that:
- "{{ zabbix_javagateway_version|float in zabbix_valid_javagateway_versions[ansible_distribution_major_version] }}"
fail_msg: Zabbix version {{ zabbix_javagateway_version }} is not supported on {{ ansible_distribution }} {{ ansible_distribution_major_version }}
tags:
- always

Expand Down
11 changes: 6 additions & 5 deletions roles/zabbix_proxy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@
- name: Set More Variables
ansible.builtin.set_fact:
zabbix_proxy_db_long: "{{ 'postgresql' if zabbix_proxy_database == 'pgsql' else zabbix_proxy_database }}"
zabbix_valid_version: "{{ zabbix_proxy_version|float in zabbix_valid_proxy_versions[ansible_distribution_major_version] }}"
zabbix_short_version: "{{ zabbix_proxy_version | regex_replace('\\.', '') }}"
zabbix_proxy_fpinglocation: "{{ zabbix_proxy_fpinglocation if zabbix_proxy_fpinglocation is defined else _zabbix_proxy_fpinglocation}}"
zabbix_proxy_fping6location: "{{ zabbix_proxy_fping6location if zabbix_proxy_fping6location is defined else _zabbix_proxy_fping6location}}"
tags:
- always

- name: Stopping Install of Invalid Version
ansible.builtin.fail:
msg: Zabbix version {{ zabbix_proxy_version }} is not supported on {{ ansible_distribution }} {{ ansible_distribution_major_version }}
when: not zabbix_valid_version
- name: Check that version is supported
when: enable_version_check | default(true) | bool
ansible.builtin.assert:
that:
- "{{ zabbix_proxy_version|float in zabbix_valid_proxy_versions[ ansible_facts['distribution_major_version'] ] }}"
fail_msg: Zabbix version {{ zabbix_proxy_version }} is not supported on {{ ansible_facts['distribution'] }} {{ ansible_facts['distribution_major_version'] }}
tags:
- always

Expand Down
11 changes: 6 additions & 5 deletions roles/zabbix_server/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,17 @@
- name: Set More Variables
ansible.builtin.set_fact:
zabbix_db_type_long: "{{ 'postgresql' if zabbix_server_database == 'pgsql' else 'mysql' }}"
zabbix_valid_version: "{{ zabbix_server_version|float in zabbix_valid_server_versions[ansible_distribution_major_version] }}"
zabbix_server_fpinglocation: "{{ zabbix_server_fpinglocation if zabbix_server_fpinglocation is defined else _zabbix_server_fpinglocation}}"
zabbix_server_fping6location: "{{ zabbix_server_fping6location if zabbix_server_fping6location is defined else _zabbix_server_fping6location}}"
tags:
- always

- name: Stopping Install of Invalid Version
ansible.builtin.fail:
msg: Zabbix version {{ zabbix_server_version }} is not supported on {{ ansible_distribution }} {{ ansible_distribution_major_version }}
when: not zabbix_valid_version
- name: Check that version is supported
when: enable_version_check | default(true) | bool
ansible.builtin.assert:
that:
- "{{ zabbix_server_version|float in zabbix_valid_server_versions[ ansible_facts['distribution_major_version'] ] }}"
fail_msg: Zabbix version {{ zabbix_server_version }} is not supported on {{ ansible_facts['distribution'] }} {{ ansible_facts['distribution_major_version'] }}
tags:
- always

Expand Down
11 changes: 6 additions & 5 deletions roles/zabbix_web/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@

- name: Set More Variables
ansible.builtin.set_fact:
zabbix_valid_version: "{{ zabbix_web_version|float in zabbix_valid_web_versions[ansible_distribution_major_version] }}"
zabbix_db_type_long: "{{ 'postgresql' if zabbix_server_database == 'pgsql' else 'mysql' }}"
tags:
- always

- name: Stopping Install of Invalid Version
ansible.builtin.fail:
msg: Zabbix version {{ zabbix_web_version }} is not supported on {{ ansible_distribution }} {{ ansible_distribution_major_version }}
when: not zabbix_valid_version
- name: Check that version is supported
when: enable_version_check | default(true) | bool
ansible.builtin.assert:
that:
- "{{ zabbix_web_version|float in zabbix_valid_web_versions[ ansible_facts['distribution_major_version'] ] }}"
fail_msg: Zabbix version {{ zabbix_web_version }} is not supported on {{ ansible_facts['distribution'] }} {{ ansible_facts['distribution_major_version'] }}
tags:
- always

Expand Down

0 comments on commit f6b6d42

Please sign in to comment.