Skip to content

Commit

Permalink
Debian 12 Support (#1005)
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrodie18 authored Jul 1, 2023
1 parent dbd82a6 commit 9856769
Show file tree
Hide file tree
Showing 22 changed files with 88 additions and 76 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- ubuntu2204
- ubuntu2004
- ubuntu1804
- debian12
- debian11
- debian10
version:
Expand All @@ -36,6 +37,9 @@ jobs:
- autopsk
- agent2
- agent2autopsk
exclude:
- container: debian12
version: v62

steps:
- name: Check out code
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/javagateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- ubuntu2204
- ubuntu2004
- ubuntu1804
- debian12
- debian11
- debian10
version:
Expand All @@ -36,6 +37,9 @@ jobs:
- interpreter: python3
- interpreter: python
container: centos7
exclude:
- container: debian12
version: v62
collection_role:
- zabbix_javagateway
steps:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- ubuntu2204
- ubuntu2004
- ubuntu1804
- debian12
- debian11
- debian10
collection_role:
Expand All @@ -42,6 +43,9 @@ jobs:
- interpreter: python3
- interpreter: python
container: centos7
exclude:
- container: debian12
version: v62
steps:
- name: Check out code
uses: actions/checkout@v1
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- ubuntu2204
- ubuntu2004
- ubuntu1804
- debian12
- debian11
- debian10
collection_role:
Expand All @@ -39,6 +40,8 @@ jobs:
include:
- interpreter: python3
exclude:
- container: debian12
version: v62
- container: debian10
version: v62
- container: ubuntu1804
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- ubuntu2204
- ubuntu2004
- ubuntu1804
- debian12
- debian11
- debian10
collection_role:
Expand All @@ -49,6 +50,8 @@ jobs:
version: v64
- container: ubuntu1804
version: v64
- container: debian12
version: v62
steps:
- name: Check out code
uses: actions/checkout@v1
Expand Down
5 changes: 5 additions & 0 deletions changelogs/fragments/debian12.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
minor_changes:
- all roles - Added support for Debian 12 (Bookworm)
- zabbix_proxy - Modified installation of Centos 7 MySQL client
- zabbix_proxy - Added installation of PyMySQL pip package
- zabbix_proxy - Standardized MySQL client installed on Debian and Ubuntu
1 change: 1 addition & 0 deletions docs/ZABBIX_AGENT_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ See the following list of supported Operating systems with the Zabbix releases:
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Ubuntu 18.04 bionic | V | V | V |
| Debian 12 bookworm | V | V | V |
| Debian 11 bullseye | V | V | V |
| Debian 10 buster | V | V | V |

Expand Down
1 change: 1 addition & 0 deletions docs/ZABBIX_JAVAGATEWAY_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ See the following list of supported Operating systems with the Zabbix releases.
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Ubuntu 18.04 bionic | V | V | V |
| Debian 12 bookworm | V | | V |
| Debian 11 bullseye | V | V | V |
| Debian 10 buster | V | V | V |

Expand Down
1 change: 1 addition & 0 deletions docs/ZABBIX_PROXY_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ See the following list of supported Operating systems with the Zabbix releases.
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Ubuntu 18.04 bionic | V | V | V |
| Debian 12 bookworm | V | | V |
| Debian 11 bullseye | V | V | V |
| Debian 10 buster | V | V | V |

Expand Down
1 change: 1 addition & 0 deletions docs/ZABBIX_SERVER_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ See the following list of supported Operating systems with the Zabbix releases:
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Ubuntu 18.04 bionic | | | V |
| Debian 12 bookworm | V | | V |
| Debian 11 bullseye | V | V | V |
| Debian 10 buster | | | V |

Expand Down
1 change: 1 addition & 0 deletions docs/ZABBIX_WEB_ROLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ See the following list of supported Operating Systems with the Zabbix releases.
| Ubuntu 22.04 jammy | V | V | V |
| Ubuntu 20.04 focal | V | V | V |
| Ubuntu 18.04 bionic | | | V |
| Debian 12 bookworm | V | | V |
| Debian 11 bullseye | V | V | V |
| Debian 10 buster | | | V |

Expand Down
4 changes: 1 addition & 3 deletions molecule/zabbix_javagateway/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
- name: Prepare
hosts: all
pre_tasks:

- name: "Set short version name"
set_fact:
zabbix_python_prefix: "python{% if ansible_python_version is version('3', '>=') %}3{% endif %}"
Expand All @@ -23,7 +22,7 @@
lineinfile:
path: /etc/dpkg/dpkg.cfg.d/excludes
state: absent
regexp: 'path-exclude=/usr/share/doc/*'
regexp: "path-exclude=/usr/share/doc/*"
when:
- ansible_os_family != 'RedHat'

Expand Down Expand Up @@ -53,7 +52,6 @@
- "{{ zabbix_python_prefix }}-apt"
- sudo
- software-properties-common
- openjdk-11-jdk
update_cache: true
state: present
register: installation_dependencies
Expand Down
1 change: 0 additions & 1 deletion molecule/zabbix_proxy/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ provisioner:
zabbix_proxy_mysql_login_user: root
zabbix_proxy_mysql_login_password: changeme
zabbix_proxy_mysql_login_port: 3306
zabbix_proxy_install_database_client: false
pgsql:
zabbix_proxy_database: pgsql
zabbix_proxy_dbport: 5432
Expand Down
53 changes: 0 additions & 53 deletions molecule/zabbix_proxy/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,56 +111,3 @@
regexp: "path-exclude=/usr/share/doc/*"
when:
- ansible_os_family != 'RedHat'

- name: PyMySQL
pip:
name: PyMySQL
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- inventory_hostname in groups['mysql']

- name: Install MariaDB (RHEL)
block:
- name: Add MariaDB Repo
ansible.builtin.yum_repository:
name: mariadb
description: MariaDB 10.8 CentOS repository list
file: mariadb
baseurl: "https://mirror.rackspace.com/mariadb/yum/10.8/centos{{ ansible_distribution_major_version }}-amd64"
gpgcheck: no
when: ansible_distribution_major_version <= '8'

- name: Install MariaDB Client
yum:
name:
- "{{ 'mariadb' if ansible_distribution_major_version >= '8' else 'MariaDB-client' }}"
- "{{ 'python3-PyMySQL' if ansible_distribution_major_version >= '8' else 'MySQL-python' }}"
when:
- ansible_os_family == 'RedHat'
- zabbix_proxy_database == 'mysql'

- name: Install MariaDB (Debian)
block:
- name: Add an Apt signing key, uses whichever key is at the URL
ansible.builtin.apt_key:
url: https://mariadb.org/mariadb_release_signing_key.asc
state: present

- name: Add specified repository into sources list
ansible.builtin.apt_repository:
repo: "deb https://mirror.rackspace.com/mariadb/repo/10.8/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} main"
state: present
validate_certs: false

- name: Install MariaDB Client
ansible.builtin.apt:
name:
- mariadb-client
- "{{ zabbix_python_prefix }}-mysqldb"
state: present
update_cache: true
allow_unauthenticated: true
when:
- ansible_os_family == 'Debian'
- zabbix_proxy_database == 'mysql'
5 changes: 5 additions & 0 deletions roles/zabbix_agent/vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ zabbix_agent2_conf: zabbix_agent2.conf

zabbix_valid_agent_versions:
# Debian
"12":
- 6.4
- 6.2
- 6.0

"11":
- 6.4
- 6.2
Expand Down
3 changes: 3 additions & 0 deletions roles/zabbix_javagateway/vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
zabbix_valid_javagateway_versions:
# Debian
"12":
- 6.4
- 6.0
"11":
- 6.4
- 6.2
Expand Down
39 changes: 25 additions & 14 deletions roles/zabbix_proxy/tasks/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@
http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
become: true
register: are_zabbix_proxy_dependency_packages_installed
until: are_zabbix_proxy_dependency_packages_installed is succeeded
register: are_zabbix_proxy_pgsql_packages_installed
until: are_zabbix_proxy_pgsql_packages_installed is succeeded
when:
- zabbix_proxy_database_creation or zabbix_proxy_database_sqlload
- zabbix_proxy_database == 'pgsql'
Expand All @@ -93,16 +93,27 @@
- database
- dependencies

- name: "RedHat | Install Mysql Client package"
yum:
name: "{{ mysql_client_pkgs[ansible_distribution_major_version] }}"
state: installed
environment:
http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
become: true
register: are_zabbix_proxy_dependency_packages_installed
until: are_zabbix_proxy_dependency_packages_installed is succeeded
- name: "RedHat | Install Mysql Client Package"
block:
- name: "RedHat | Add Mysql Repo (Centos 7 Only)"
ansible.builtin.yum_repository:
name: mariadb
description: MariaDB 10.8 CentOS repository list
file: mariadb
baseurl: "https://mirror.rackspace.com/mariadb/yum/10.8/centos{{ ansible_distribution_major_version }}-amd64"
gpgcheck: no
when: ansible_distribution_major_version == '7'

- name: "RedHat | Install Mysql Client package"
yum:
name: "{{ mysql_client_pkgs[ansible_distribution_major_version] }}"
state: installed
environment:
http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
become: true
register: are_zabbix_proxy_mysql_packages_installed
until: are_zabbix_proxy_mysql_packages_installed is succeeded
when:
- zabbix_proxy_database_creation or zabbix_proxy_database_sqlload
- zabbix_proxy_install_database_client
Expand All @@ -120,8 +131,8 @@
environment:
http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}"
https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}"
register: zabbix_proxy_dependencies_installed
until: zabbix_proxy_dependencies_installed is succeeded
register: zabbix_proxy_sqlite_packages_installed
until: zabbix_proxy_sqlite_packages_installed is succeeded
become: true
when:
- zabbix_proxy_database == 'sqlite3'
Expand Down
9 changes: 9 additions & 0 deletions roles/zabbix_proxy/tasks/mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
tags:
- database

- name: PyMySQL
pip:
name: PyMySQL
register: installation_dependencies
until: installation_dependencies is succeeded
when:
- inventory_hostname in groups['mysql']

- name: "MySQL | Create database"
community.mysql.mysql_db:
name: "{{ zabbix_proxy_dbname }}"
Expand Down Expand Up @@ -52,6 +60,7 @@
password: "{{ zabbix_proxy_dbpassword }}"
priv: "{{ zabbix_proxy_dbname }}.*:ALL"
host: "{{ zabbix_proxy_privileged_host }}"
plugin: "{{ 'mysql_native_password' if (ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7') else omit }}"
state: present
when: zabbix_proxy_database_creation
delegate_to: "{{ delegated_dbhost }}"
Expand Down
14 changes: 10 additions & 4 deletions roles/zabbix_proxy/vars/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
zabbix_valid_proxy_versions:
# Debian
"12":
- 6.4
- 6.0
"11":
- 6.4
- 6.2
Expand All @@ -23,21 +26,24 @@ zabbix_valid_proxy_versions:

mysql_client_pkgs:
# Debian
"12":
- default-mysql-client
- "{{ zabbix_python_prefix }}-mysqldb"
"11":
- mycli
- default-mysql-client
- "{{ zabbix_python_prefix }}-mysqldb"
"10":
- mariadb-client
- "{{ zabbix_python_prefix }}-mysqldb"
# Ubuntu
"22":
- mycli
- default-mysql-client
- "{{ zabbix_python_prefix }}-mysqldb"
"20":
- mycli
- default-mysql-client
- "{{ zabbix_python_prefix }}-mysqldb"
"18":
- mycli
- default-mysql-client
- "{{ zabbix_python_prefix }}-mysqldb"

mysql_plugin:
Expand Down
2 changes: 1 addition & 1 deletion roles/zabbix_proxy/vars/RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ mysql_client_pkgs:
- mysql
- python3-PyMySQL
"7":
- mariadb
- MariaDB-client
- MySQL-python

selinux_pkgs:
Expand Down
3 changes: 3 additions & 0 deletions roles/zabbix_server/vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ mysql_create_dir: ""

zabbix_valid_server_versions:
# Debian
"12":
- 6.4
- 6.0
"11":
- 6.4
- 6.2
Expand Down
3 changes: 3 additions & 0 deletions roles/zabbix_web/vars/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ _nginx_tls_dhparam: /etc/ssl/private/dhparams.pem

zabbix_valid_web_versions:
# Debian
"12":
- 6.4
- 6.0
"11":
- 6.4
- 6.2
Expand Down

0 comments on commit 9856769

Please sign in to comment.