diff --git a/.github/workflows/agent.yml b/.github/workflows/agent.yml index 55b7e1b72..e081e6721 100644 --- a/.github/workflows/agent.yml +++ b/.github/workflows/agent.yml @@ -22,6 +22,7 @@ jobs: container: - rockylinux9 - rockylinux8 + - ubuntu2404 - ubuntu2204 - ubuntu2004 - ubuntu1804 @@ -40,6 +41,8 @@ jobs: exclude: - container: debian12 version: v62 + - container: ubuntu2404 + version: v62 steps: - name: Check out code diff --git a/.github/workflows/javagateway.yml b/.github/workflows/javagateway.yml index 22bc5ede1..96ca2a8b7 100644 --- a/.github/workflows/javagateway.yml +++ b/.github/workflows/javagateway.yml @@ -23,6 +23,7 @@ jobs: - rockylinux9 - rockylinux8 - centos7 + - ubuntu2404 - ubuntu2204 - ubuntu2004 - ubuntu1804 @@ -40,6 +41,8 @@ jobs: exclude: - container: debian12 version: v62 + - container: ubuntu2404 + version: v62 collection_role: - zabbix_javagateway steps: diff --git a/.github/workflows/proxy.yml b/.github/workflows/proxy.yml index ad5f61b34..ab52f9dfc 100644 --- a/.github/workflows/proxy.yml +++ b/.github/workflows/proxy.yml @@ -23,6 +23,7 @@ jobs: - rockylinux9 - rockylinux8 - centos7 + - ubuntu2404 - ubuntu2204 - ubuntu2004 - ubuntu1804 @@ -46,6 +47,8 @@ jobs: exclude: - container: debian12 version: v62 + - container: ubuntu2404 + version: v62 steps: - name: Check out code uses: actions/checkout@v4 diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index f2bdb5a3b..9ca8f3761 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -22,6 +22,7 @@ jobs: container: - rockylinux9 - rockylinux8 + - ubuntu2404 - ubuntu2204 - ubuntu2004 - ubuntu1804 @@ -42,6 +43,8 @@ jobs: version: v62 - container: debian10 version: v62 + - container: ubuntu2404 + version: v62 - container: ubuntu1804 version: v62 - container: ubuntu1804 diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml index 9ee402bf0..ec60c540d 100644 --- a/.github/workflows/web.yml +++ b/.github/workflows/web.yml @@ -22,6 +22,7 @@ jobs: container: - rockylinux9 - rockylinux8 + - ubuntu2404 - ubuntu2204 - ubuntu2004 - ubuntu1804 @@ -45,6 +46,8 @@ jobs: exclude: - container: debian10 version: v62 + - container: ubuntu2404 + version: v62 - container: ubuntu1804 version: v62 - container: debian10 diff --git a/changelogs/fragments/1221-add_support_for_ubuntu_24.04.yml b/changelogs/fragments/1221-add_support_for_ubuntu_24.04.yml new file mode 100644 index 000000000..43c3a2e6d --- /dev/null +++ b/changelogs/fragments/1221-add_support_for_ubuntu_24.04.yml @@ -0,0 +1,2 @@ +minor_changes: + - all roles - Added support for Ubuntu 24.04 (Noble Numbat) diff --git a/docs/ZABBIX_AGENT_ROLE.md b/docs/ZABBIX_AGENT_ROLE.md index 410004ac3..426570223 100644 --- a/docs/ZABBIX_AGENT_ROLE.md +++ b/docs/ZABBIX_AGENT_ROLE.md @@ -94,6 +94,7 @@ See the following list of supported Operating systems with the Zabbix releases: | Red Hat Fam 9 | V | V | V | | Red Hat Fam 8 | V | V | V | | Red Hat Fam 7 | V | V | V | +| Ubuntu 24.04 noble | V | | V | | Ubuntu 22.04 jammy | V | V | V | | Ubuntu 20.04 focal | V | V | V | | Ubuntu 18.04 bionic | V | V | V | @@ -119,7 +120,7 @@ The following is an overview of all available configuration default for this rol * `zabbix_agent_disable_repo`: A list of repos to disable during install. Default `epel`. * `zabbix_repo_deb_url`: The URL to the Zabbix repository. Default `http://repo.zabbix.com/zabbix/{{ zabbix_agent_version }}/{{ ansible_distribution.lower() }}` * `zabbix_repo_deb_component`: The repository component for Debian installs. Default `main`. -* `zabbix_repo_deb_gpg_key_url`: The URL to download the Zabbix GPG key from. Default `http://repo.zabbix.com/zabbix-official-repo.key`. +* `zabbix_repo_deb_gpg_key_url`: The URL to download the Zabbix GPG key from. Default `http://repo.zabbix.com/zabbix-official-repo.key` (or `https://repo.zabbix.com/zabbix-official-repo-apr2024.gpg` for Ubuntu 24.04 repo). * `zabbix_repo_deb_include_deb_src`: True, if deb-src should be included in the zabbix.sources entry. Default `true`. ### SElinux diff --git a/docs/ZABBIX_JAVAGATEWAY_ROLE.md b/docs/ZABBIX_JAVAGATEWAY_ROLE.md index 47092a6a0..66fdf95f3 100644 --- a/docs/ZABBIX_JAVAGATEWAY_ROLE.md +++ b/docs/ZABBIX_JAVAGATEWAY_ROLE.md @@ -39,6 +39,7 @@ See the following list of supported Operating systems with the Zabbix releases. | Red Hat Fam 9 | V | V | V | | Red Hat Fam 8 | V | V | V | | Red Hat Fam 7 | V | V | V | +| Ubuntu 24.04 noble | V | | V | | Ubuntu 22.04 jammy | V | V | V | | Ubuntu 20.04 focal | V | V | V | | Ubuntu 18.04 bionic | V | V | V | @@ -64,7 +65,7 @@ The `zabbix_javagateway_version` is optional. The latest available major.minor v * `zabbix_javagateway_conf_mode`: Default: `0644`. The "mode" for the Zabbix configuration file. * `zabbix_repo_deb_url`: The URL to the Zabbix repository. Default `http://repo.zabbix.com/zabbix/{{ zabbix_agent_version }}/{{ ansible_distribution.lower() }}` * `zabbix_repo_deb_component`: The repository component for Debian installs. Default `main`. -* `zabbix_repo_deb_gpg_key_url`: The URL to download the Zabbix GPG key from. Default `http://repo.zabbix.com/zabbix-official-repo.key`. +* `zabbix_repo_deb_gpg_key_url`: The URL to download the Zabbix GPG key from. Default `http://repo.zabbix.com/zabbix-official-repo.key` (or `https://repo.zabbix.com/zabbix-official-repo-apr2024.gpg` for Ubuntu 24.04 repo). * `zabbix_repo_deb_include_deb_src`: True, if deb-src should be included in the zabbix.sources entry. Default `true`. ### Java Gatewaty diff --git a/docs/ZABBIX_PROXY_ROLE.md b/docs/ZABBIX_PROXY_ROLE.md index ee558c8b7..b02e8fffe 100644 --- a/docs/ZABBIX_PROXY_ROLE.md +++ b/docs/ZABBIX_PROXY_ROLE.md @@ -82,6 +82,7 @@ See the following list of supported Operating systems with the Zabbix releases. | Red Hat Fam 9 | V | V | V | | Red Hat Fam 8 | V | V | V | | Red Hat Fam 7 | V | V | V | +| Ubuntu 24.04 noble | V | | V | | Ubuntu 22.04 jammy | V | V | V | | Ubuntu 20.04 focal | V | V | V | | Ubuntu 18.04 bionic | V | V | V | @@ -135,7 +136,7 @@ The following is an overview of all available configuration default for this rol * `*zabbix_proxy_package_state`: Default: `present`. Can be overridden to `latest` to update packages * `zabbix_repo_deb_url`: The URL to the Zabbix repository. Default `http://repo.zabbix.com/zabbix/{{ zabbix_proxy_version }}/{{ ansible_distribution.lower() }}` * `zabbix_repo_deb_component`: The repository component for Debian installs. Default `main`. -* `zabbix_repo_deb_gpg_key_url`: The URL to download the Zabbix GPG key from. Default `http://repo.zabbix.com/zabbix-official-repo.key`. +* `zabbix_repo_deb_gpg_key_url`: The URL to download the Zabbix GPG key from. Default `http://repo.zabbix.com/zabbix-official-repo.key` (or `https://repo.zabbix.com/zabbix-official-repo-apr2024.gpg` for Ubuntu 24.04 repo). * `zabbix_repo_deb_include_deb_src`: True, if deb-src should be included in the zabbix.sources entry. Default `true`. ### SElinux diff --git a/docs/ZABBIX_SERVER_ROLE.md b/docs/ZABBIX_SERVER_ROLE.md index 9557281c3..cb8b4ccdd 100644 --- a/docs/ZABBIX_SERVER_ROLE.md +++ b/docs/ZABBIX_SERVER_ROLE.md @@ -79,6 +79,7 @@ See the following list of supported Operating systems with the Zabbix releases: |---------------------|-----|-----|-----| | Red Hat Fam 9 | V | V | V | | Red Hat Fam 8 | V | V | V | +| Ubuntu 24.04 noble | V | | V | | Ubuntu 22.04 jammy | V | V | V | | Ubuntu 20.04 focal | V | V | V | | Ubuntu 18.04 bionic | | | V | @@ -111,7 +112,7 @@ The following is an overview of all available configuration default for this rol * `zabbix_service_enabled`: Default: `True` Can be overridden to `False` if needed * `zabbix_repo_deb_url`: The URL to the Zabbix repository. Default `http://repo.zabbix.com/zabbix/{{ zabbix_server_version }}/{{ ansible_distribution.lower() }}` * `zabbix_repo_deb_component`: The repository component for Debian installs. Default `main`. -* `zabbix_repo_deb_gpg_key_url`: The URL to download the Zabbix GPG key from. Default `http://repo.zabbix.com/zabbix-official-repo.key`. +* `zabbix_repo_deb_gpg_key_url`: The URL to download the Zabbix GPG key from. Default `http://repo.zabbix.com/zabbix-official-repo.key` (or `https://repo.zabbix.com/zabbix-official-repo-apr2024.gpg` for Ubuntu 24.04 repo). * `zabbix_repo_deb_include_deb_src`: True, if deb-src should be included in the zabbix.sources entry. Default `true`. ### SElinux diff --git a/docs/ZABBIX_WEB_ROLE.md b/docs/ZABBIX_WEB_ROLE.md index aac6f9dc2..9032240a9 100644 --- a/docs/ZABBIX_WEB_ROLE.md +++ b/docs/ZABBIX_WEB_ROLE.md @@ -59,6 +59,7 @@ See the following list of supported Operating Systems with the Zabbix releases. |---------------------|-----|-----|-----| | Red Hat Fam 9 | V | V | V | | Red Hat Fam 8 | V | V | V | +| Ubuntu 24.04 noble | V | | V | | Ubuntu 22.04 jammy | V | V | V | | Ubuntu 20.04 focal | V | V | V | | Ubuntu 18.04 bionic | | | V | @@ -97,7 +98,7 @@ The following is an overview of all available configuration defaults for this ro * `zabbix_web_conf_mode`: Default: `0644`. The "mode" for the Zabbix configuration file. * `zabbix_repo_deb_url`: The URL to the Zabbix repository. Default `http://repo.zabbix.com/zabbix/{{ zabbix_web_version }}/{{ ansible_distribution.lower() }}` * `zabbix_repo_deb_component`: The repository component for Debian installs. Default `main`. -* `zabbix_repo_deb_gpg_key_url`: The URL to download the Zabbix GPG key from. Default `http://repo.zabbix.com/zabbix-official-repo.key`. +* `zabbix_repo_deb_gpg_key_url`: The URL to download the Zabbix GPG key from. Default `http://repo.zabbix.com/zabbix-official-repo.key` (or `https://repo.zabbix.com/zabbix-official-repo-apr2024.gpg` for Ubuntu 24.04 repo). * `zabbix_repo_deb_include_deb_src`: True, if deb-src should be included in the zabbix.sources entry. Default `true`. ### Zabbix Web specific diff --git a/molecule/requirements.txt b/molecule/requirements.txt index 9ccb5e157..814a46a91 100644 --- a/molecule/requirements.txt +++ b/molecule/requirements.txt @@ -1,7 +1,7 @@ # Install CI dependencies for the Zabbix Roles -ansible==7.0.0 +#ansible==8.0.0 # commented out to avoid installing collections in site-packages/ansible_collections ansible-compat==3.0.0 -ansible-core==2.14.2 +ansible-core==2.15.11 docker==6.1.3 molecule<5 molecule-docker @ git+https://github.com/ansible-community/molecule-docker@main diff --git a/molecule/zabbix_web/prepare.yml b/molecule/zabbix_web/prepare.yml index d3dcc1ad0..7d8142763 100644 --- a/molecule/zabbix_web/prepare.yml +++ b/molecule/zabbix_web/prepare.yml @@ -83,7 +83,7 @@ when: ansible_version.full is version("2.14", "<") - name: "Apt update" - ansible.builtin.shell: "apt-get update && echo exit 0 > /usr/sbin/policy-rc.d" + ansible.builtin.shell: "apt-get update" args: warn: "{{ produce_warn | default(omit) }}" register: installation_dependencies @@ -162,7 +162,14 @@ - ansible_distribution_major_version >= '22' - ansible_os_family == "Debian" - - name: Set PHP packages (Ubuntu 2204) + - name: Set PHP Version (Ubuntu 2404) + ansible.builtin.set_fact: + __php_default_version_debian: "8.3" + when: + - ansible_distribution_major_version >= '24' + - ansible_os_family == "Debian" + + - name: Set PHP packages (Ubuntu 2204 & 2404) ansible.builtin.set_fact: __php_packages: - php{{ __php_default_version_debian }}-common diff --git a/roles/zabbix_agent/defaults/main.yml b/roles/zabbix_agent/defaults/main.yml index 219182e96..4e44a2961 100644 --- a/roles/zabbix_agent/defaults/main.yml +++ b/roles/zabbix_agent/defaults/main.yml @@ -18,7 +18,6 @@ zabbix_agent_tlspskidentity_file: "/etc/zabbix/tls_psk_auto.identity" # Selinux related vars selinux_allow_zabbix_run_sudo: false -zabbix_repo_deb_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key zabbix_repo_deb_include_deb_src: true zabbix_agent_install_agent_only: false diff --git a/roles/zabbix_agent/tasks/Debian.yml b/roles/zabbix_agent/tasks/Debian.yml index 940f1e2f0..2b9902cd6 100644 --- a/roles/zabbix_agent/tasks/Debian.yml +++ b/roles/zabbix_agent/tasks/Debian.yml @@ -40,8 +40,8 @@ - name: "Debian | Download gpg key" when: not ansible_check_mode # Because get_url always has changed status in check_mode. ansible.builtin.get_url: - url: "{{ zabbix_repo_deb_gpg_key_url }}" - dest: "{{ zabbix_gpg_key }}" + url: "{{ zabbix_repo_deb_gpg_key_url | default(_zabbix_repo_default_deb_gpg_key_url_by_distrib[ansible_distribution_major_version]) }}" + dest: "{{ zabbix_gpg_key | default(_zabbix_gpg_key_default_by_distrib[ansible_distribution_major_version]) }}" mode: "0644" force: true environment: @@ -64,7 +64,7 @@ Suites: {{ ansible_distribution_release }} Components: {{ zabbix_repo_deb_component }} Architectures: {{ 'amd64' if ansible_machine != 'aarch64' else 'arm64'}} - Signed-By: {{ zabbix_gpg_key }} + Signed-By: {{ zabbix_gpg_key | default(_zabbix_gpg_key_default_by_distrib[ansible_distribution_major_version]) }} become: true tags: - install diff --git a/roles/zabbix_agent/vars/Debian.yml b/roles/zabbix_agent/vars/Debian.yml index 0c9a98299..88374e889 100644 --- a/roles/zabbix_agent/vars/Debian.yml +++ b/roles/zabbix_agent/vars/Debian.yml @@ -25,6 +25,10 @@ zabbix_valid_agent_versions: - 6.2 - 6.0 # Ubuntu + "24": + - 6.4 + - 6.0 + "22": - 6.4 - 6.2 @@ -41,4 +45,21 @@ zabbix_valid_agent_versions: - 6.0 debian_keyring_path: /etc/apt/keyrings/ -zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.asc" +_zabbix_gpg_key_default_by_distrib: + "12": "{{ debian_keyring_path }}zabbix-repo.asc" + "11": "{{ debian_keyring_path }}zabbix-repo.asc" + "10": "{{ debian_keyring_path }}zabbix-repo.asc" + "9": "{{ debian_keyring_path }}zabbix-repo.asc" + "24": "{{ debian_keyring_path }}zabbix-repo.gpg" + "22": "{{ debian_keyring_path }}zabbix-repo.asc" + "20": "{{ debian_keyring_path }}zabbix-repo.asc" + "18": "{{ debian_keyring_path }}zabbix-repo.asc" +_zabbix_repo_default_deb_gpg_key_url_by_distrib: + "12": https://repo.zabbix.com/zabbix-official-repo.key + "11": https://repo.zabbix.com/zabbix-official-repo.key + "10": https://repo.zabbix.com/zabbix-official-repo.key + "9": https://repo.zabbix.com/zabbix-official-repo.key + "24": https://repo.zabbix.com/zabbix-official-repo-apr2024.gpg + "22": https://repo.zabbix.com/zabbix-official-repo.key + "20": https://repo.zabbix.com/zabbix-official-repo.key + "18": https://repo.zabbix.com/zabbix-official-repo.key diff --git a/roles/zabbix_javagateway/defaults/main.yml b/roles/zabbix_javagateway/defaults/main.yml index d7f659648..6bf37be29 100644 --- a/roles/zabbix_javagateway/defaults/main.yml +++ b/roles/zabbix_javagateway/defaults/main.yml @@ -33,5 +33,4 @@ zabbix_javagateway_listenip: 0.0.0.0 zabbix_javagateway_listenport: 10052 zabbix_javagateway_startpollers: 5 -zabbix_repo_deb_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key zabbix_repo_deb_include_deb_src: true diff --git a/roles/zabbix_javagateway/tasks/Debian.yml b/roles/zabbix_javagateway/tasks/Debian.yml index ad762aa3b..c0c4ee4e2 100644 --- a/roles/zabbix_javagateway/tasks/Debian.yml +++ b/roles/zabbix_javagateway/tasks/Debian.yml @@ -21,8 +21,8 @@ - name: "Debian | Download gpg key" when: not ansible_check_mode # Because get_url always has changed status in check_mode. ansible.builtin.get_url: - url: "{{ zabbix_repo_deb_gpg_key_url }}" - dest: "{{ zabbix_gpg_key }}" + url: "{{ zabbix_repo_deb_gpg_key_url | default(_zabbix_repo_default_deb_gpg_key_url_by_distrib[ansible_distribution_major_version]) }}" + dest: "{{ zabbix_gpg_key | default(_zabbix_gpg_key_default_by_distrib[ansible_distribution_major_version]) }}" mode: "0644" force: true environment: @@ -45,11 +45,16 @@ Suites: {{ ansible_distribution_release }} Components: {{ zabbix_repo_deb_component }} Architectures: {{ 'amd64' if ansible_machine != 'aarch64' else 'arm64'}} - Signed-By: {{ zabbix_gpg_key }} + Signed-By: {{ zabbix_gpg_key | default(_zabbix_gpg_key_default_by_distrib[ansible_distribution_major_version]) }} + register: zabbix_repo become: true tags: - install +- name: "Debian | Update apt cache if repo was added" + ansible.builtin.apt: update_cache=yes + when: zabbix_repo is changed + - name: "Debian | Installing zabbix-java-gateway" ansible.builtin.apt: pkg: zabbix-java-gateway diff --git a/roles/zabbix_javagateway/vars/Debian.yml b/roles/zabbix_javagateway/vars/Debian.yml index 7c36d2d3a..eea1921f8 100644 --- a/roles/zabbix_javagateway/vars/Debian.yml +++ b/roles/zabbix_javagateway/vars/Debian.yml @@ -12,6 +12,9 @@ zabbix_valid_javagateway_versions: - 6.2 - 6.0 # Ubuntu + "24": + - 6.4 + - 6.0 "22": - 6.4 - 6.2 @@ -26,4 +29,19 @@ zabbix_valid_javagateway_versions: - 6.0 debian_keyring_path: /etc/apt/keyrings/ -zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.asc" +_zabbix_gpg_key_default_by_distrib: + "12": "{{ debian_keyring_path }}zabbix-repo.asc" + "11": "{{ debian_keyring_path }}zabbix-repo.asc" + "10": "{{ debian_keyring_path }}zabbix-repo.asc" + "24": "{{ debian_keyring_path }}zabbix-repo.gpg" + "22": "{{ debian_keyring_path }}zabbix-repo.asc" + "20": "{{ debian_keyring_path }}zabbix-repo.asc" + "18": "{{ debian_keyring_path }}zabbix-repo.asc" +_zabbix_repo_default_deb_gpg_key_url_by_distrib: + "12": https://repo.zabbix.com/zabbix-official-repo.key + "11": https://repo.zabbix.com/zabbix-official-repo.key + "10": https://repo.zabbix.com/zabbix-official-repo.key + "24": https://repo.zabbix.com/zabbix-official-repo-apr2024.gpg + "22": https://repo.zabbix.com/zabbix-official-repo.key + "20": https://repo.zabbix.com/zabbix-official-repo.key + "18": https://repo.zabbix.com/zabbix-official-repo.key diff --git a/roles/zabbix_proxy/defaults/main.yml b/roles/zabbix_proxy/defaults/main.yml index b2b74ebec..d7bc80a64 100644 --- a/roles/zabbix_proxy/defaults/main.yml +++ b/roles/zabbix_proxy/defaults/main.yml @@ -62,7 +62,6 @@ zabbix_repo_yum: state: present zabbix_proxy_apt_priority: zabbix_proxy_package_state: present -zabbix_repo_deb_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key zabbix_repo_deb_include_deb_src: true # Proxy Configuration Variables (Only ones with role provided defaults) diff --git a/roles/zabbix_proxy/tasks/Debian.yml b/roles/zabbix_proxy/tasks/Debian.yml index bef68b27a..79534eceb 100644 --- a/roles/zabbix_proxy/tasks/Debian.yml +++ b/roles/zabbix_proxy/tasks/Debian.yml @@ -46,8 +46,8 @@ - name: "Debian | Download gpg key" when: not ansible_check_mode # Because get_url always has changed status in check_mode. ansible.builtin.get_url: - url: "{{ zabbix_repo_deb_gpg_key_url }}" - dest: "{{ zabbix_gpg_key }}" + url: "{{ zabbix_repo_deb_gpg_key_url | default(_zabbix_repo_default_deb_gpg_key_url_by_distrib[ansible_distribution_major_version]) }}" + dest: "{{ zabbix_gpg_key | default(_zabbix_gpg_key_default_by_distrib[ansible_distribution_major_version]) }}" mode: "0644" force: true environment: @@ -72,7 +72,7 @@ Suites: {{ ansible_distribution_release }} Components: {{ zabbix_repo_deb_component }} Architectures: {{ 'amd64' if ansible_machine != 'aarch64' else 'arm64'}} - Signed-By: {{ zabbix_gpg_key }} + Signed-By: {{ zabbix_gpg_key | default(_zabbix_gpg_key_default_by_distrib[ansible_distribution_major_version]) }} become: true tags: - install diff --git a/roles/zabbix_proxy/vars/Debian.yml b/roles/zabbix_proxy/vars/Debian.yml index 1362e557e..8e5eb356c 100644 --- a/roles/zabbix_proxy/vars/Debian.yml +++ b/roles/zabbix_proxy/vars/Debian.yml @@ -11,6 +11,9 @@ zabbix_valid_proxy_versions: - 6.4 - 6.2 - 6.0 + "24": + - 6.4 + - 6.0 "22": - 6.4 - 6.2 @@ -36,6 +39,9 @@ mysql_client_pkgs: - mariadb-client - "{{ zabbix_python_prefix }}-mysqldb" # Ubuntu + "24": + - default-mysql-client + - "{{ zabbix_python_prefix }}-mysqldb" "22": - default-mysql-client - "{{ zabbix_python_prefix }}-mysqldb" @@ -51,6 +57,22 @@ mysql_plugin: "10": mysql_native_password debian_keyring_path: /etc/apt/keyrings/ -zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.asc" +_zabbix_gpg_key_default_by_distrib: + "12": "{{ debian_keyring_path }}zabbix-repo.asc" + "11": "{{ debian_keyring_path }}zabbix-repo.asc" + "10": "{{ debian_keyring_path }}zabbix-repo.asc" + "24": "{{ debian_keyring_path }}zabbix-repo.gpg" + "22": "{{ debian_keyring_path }}zabbix-repo.asc" + "20": "{{ debian_keyring_path }}zabbix-repo.asc" + "18": "{{ debian_keyring_path }}zabbix-repo.asc" +_zabbix_repo_default_deb_gpg_key_url_by_distrib: + "12": https://repo.zabbix.com/zabbix-official-repo.key + "11": https://repo.zabbix.com/zabbix-official-repo.key + "10": https://repo.zabbix.com/zabbix-official-repo.key + "24": https://repo.zabbix.com/zabbix-official-repo-apr2024.gpg + "22": https://repo.zabbix.com/zabbix-official-repo.key + "20": https://repo.zabbix.com/zabbix-official-repo.key + "18": https://repo.zabbix.com/zabbix-official-repo.key + _zabbix_proxy_fping6location: /usr/bin/fping6 _zabbix_proxy_fpinglocation: /usr/bin/fping diff --git a/roles/zabbix_server/defaults/main.yml b/roles/zabbix_server/defaults/main.yml index b3c669ba9..9b9406561 100644 --- a/roles/zabbix_server/defaults/main.yml +++ b/roles/zabbix_server/defaults/main.yml @@ -61,7 +61,6 @@ zabbix_repo_yum: state: present zabbix_server_apt_priority: zabbix_server_conf_mode: 0640 -zabbix_repo_deb_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key zabbix_repo_deb_include_deb_src: true # Server Configuration Variables (Only ones with role provided defaults) diff --git a/roles/zabbix_server/tasks/Debian.yml b/roles/zabbix_server/tasks/Debian.yml index c7b106614..dbbc3a5ad 100644 --- a/roles/zabbix_server/tasks/Debian.yml +++ b/roles/zabbix_server/tasks/Debian.yml @@ -38,8 +38,8 @@ - name: "Debian | Download gpg key" when: not ansible_check_mode # Because get_url always has changed status in check_mode. ansible.builtin.get_url: - url: "{{ zabbix_repo_deb_gpg_key_url }}" - dest: "{{ zabbix_gpg_key }}" + url: "{{ zabbix_repo_deb_gpg_key_url | default(_zabbix_repo_default_deb_gpg_key_url_by_distrib[ansible_distribution_major_version]) }}" + dest: "{{ zabbix_gpg_key | default(_zabbix_gpg_key_default_by_distrib[ansible_distribution_major_version]) }}" mode: "0644" force: true environment: @@ -64,7 +64,7 @@ Suites: {{ ansible_distribution_release }} Components: {{ zabbix_repo_deb_component }} Architectures: {{ 'amd64' if ansible_machine != 'aarch64' else 'arm64'}} - Signed-By: {{ zabbix_gpg_key }} + Signed-By: {{ zabbix_gpg_key | default(_zabbix_gpg_key_default_by_distrib[ansible_distribution_major_version]) }} become: true tags: - install diff --git a/roles/zabbix_server/tasks/initialize-mysql.yml b/roles/zabbix_server/tasks/initialize-mysql.yml index 9787bc21d..b16b475c9 100644 --- a/roles/zabbix_server/tasks/initialize-mysql.yml +++ b/roles/zabbix_server/tasks/initialize-mysql.yml @@ -82,7 +82,7 @@ query: 'SELECT mandatory FROM dbversion' rescue: - name: "MySQL | Get and set schema import overrides" - delegate_to: "{{ zabbix_server_real_dbhost | default(zabbix_server_dbhost_run_install | ternary(delegated_dbhost, inventory_hostname)) }}" + delegate_to: "{{ zabbix_server_real_dbhost | default(zabbix_server_dbhost_run_install | ternary(delegated_dbhost, inventory_hostname), true) }}" block: - name: "MySQL | Get current value for variables" community.mysql.mysql_variables: @@ -142,7 +142,7 @@ always: - name: "MySQL | Revert variable overrides for schema import" - delegate_to: "{{ zabbix_server_real_dbhost | default(zabbix_server_dbhost_run_install | ternary(delegated_dbhost, inventory_hostname)) }}" + delegate_to: "{{ zabbix_server_real_dbhost | default(zabbix_server_dbhost_run_install | ternary(delegated_dbhost, inventory_hostname), true) }}" community.mysql.mysql_variables: variable: "{{ item.name }}" value: "{{ item.msg }}" diff --git a/roles/zabbix_server/vars/Debian.yml b/roles/zabbix_server/vars/Debian.yml index 75f3751c2..78cdafdef 100644 --- a/roles/zabbix_server/vars/Debian.yml +++ b/roles/zabbix_server/vars/Debian.yml @@ -17,6 +17,9 @@ zabbix_valid_server_versions: "10": - 6.0 # Ubuntu + "24": + - 6.4 + - 6.0 "22": - 6.4 - 6.2 @@ -29,7 +32,22 @@ zabbix_valid_server_versions: - 6.0 debian_keyring_path: /etc/apt/keyrings/ -zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.asc" +_zabbix_gpg_key_default_by_distrib: + "12": "{{ debian_keyring_path }}zabbix-repo.asc" + "11": "{{ debian_keyring_path }}zabbix-repo.asc" + "10": "{{ debian_keyring_path }}zabbix-repo.asc" + "24": "{{ debian_keyring_path }}zabbix-repo.gpg" + "22": "{{ debian_keyring_path }}zabbix-repo.asc" + "20": "{{ debian_keyring_path }}zabbix-repo.asc" + "18": "{{ debian_keyring_path }}zabbix-repo.asc" +_zabbix_repo_default_deb_gpg_key_url_by_distrib: + "12": https://repo.zabbix.com/zabbix-official-repo.key + "11": https://repo.zabbix.com/zabbix-official-repo.key + "10": https://repo.zabbix.com/zabbix-official-repo.key + "24": https://repo.zabbix.com/zabbix-official-repo-apr2024.gpg + "22": https://repo.zabbix.com/zabbix-official-repo.key + "20": https://repo.zabbix.com/zabbix-official-repo.key + "18": https://repo.zabbix.com/zabbix-official-repo.key _zabbix_server_pgsql_dependencies: - "{{ zabbix_server_install_database_client | ternary('postgresql-client', '') }}" diff --git a/roles/zabbix_web/defaults/main.yml b/roles/zabbix_web/defaults/main.yml index 53744bab9..d7c23ac1d 100644 --- a/roles/zabbix_web/defaults/main.yml +++ b/roles/zabbix_web/defaults/main.yml @@ -93,7 +93,6 @@ selinux_allow_httpd_can_connect_ldap: false selinux_allow_httpd_can_network_connect_db: false selinux_allow_httpd_can_connect_zabbix: false -zabbix_repo_deb_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key zabbix_repo_deb_include_deb_src: true # SAML certificates diff --git a/roles/zabbix_web/tasks/Debian.yml b/roles/zabbix_web/tasks/Debian.yml index d3c12fdac..dd07b9430 100644 --- a/roles/zabbix_web/tasks/Debian.yml +++ b/roles/zabbix_web/tasks/Debian.yml @@ -63,8 +63,8 @@ - name: "Debian | Download gpg key" when: not ansible_check_mode # Because get_url always has changed status in check_mode. ansible.builtin.get_url: - url: "{{ zabbix_repo_deb_gpg_key_url }}" - dest: "{{ zabbix_gpg_key }}" + url: "{{ zabbix_repo_deb_gpg_key_url | default(_zabbix_repo_default_deb_gpg_key_url_by_distrib[ansible_distribution_major_version]) }}" + dest: "{{ zabbix_gpg_key | default(_zabbix_gpg_key_default_by_distrib[ansible_distribution_major_version]) }}" mode: "0644" force: true environment: @@ -87,7 +87,7 @@ Suites: {{ ansible_distribution_release }} Components: {{ zabbix_repo_deb_component }} Architectures: {{ 'amd64' if ansible_machine != 'aarch64' else 'arm64'}} - Signed-By: {{ zabbix_gpg_key }} + Signed-By: {{ zabbix_gpg_key | default(_zabbix_gpg_key_default_by_distrib[ansible_distribution_major_version]) }} become: true tags: - install diff --git a/roles/zabbix_web/vars/Debian.yml b/roles/zabbix_web/vars/Debian.yml index f49b27155..be8aac4a4 100644 --- a/roles/zabbix_web/vars/Debian.yml +++ b/roles/zabbix_web/vars/Debian.yml @@ -35,6 +35,9 @@ zabbix_valid_web_versions: "10": - 6.0 # Ubuntu + "24": + - 6.4 + - 6.0 "22": - 6.4 - 6.2 @@ -47,4 +50,19 @@ zabbix_valid_web_versions: - 6.0 debian_keyring_path: /etc/apt/keyrings/ -zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.asc" +_zabbix_gpg_key_default_by_distrib: + "12": "{{ debian_keyring_path }}zabbix-repo.asc" + "11": "{{ debian_keyring_path }}zabbix-repo.asc" + "10": "{{ debian_keyring_path }}zabbix-repo.asc" + "24": "{{ debian_keyring_path }}zabbix-repo.gpg" + "22": "{{ debian_keyring_path }}zabbix-repo.asc" + "20": "{{ debian_keyring_path }}zabbix-repo.asc" + "18": "{{ debian_keyring_path }}zabbix-repo.asc" +_zabbix_repo_default_deb_gpg_key_url_by_distrib: + "12": https://repo.zabbix.com/zabbix-official-repo.key + "11": https://repo.zabbix.com/zabbix-official-repo.key + "10": https://repo.zabbix.com/zabbix-official-repo.key + "24": https://repo.zabbix.com/zabbix-official-repo-apr2024.gpg + "22": https://repo.zabbix.com/zabbix-official-repo.key + "20": https://repo.zabbix.com/zabbix-official-repo.key + "18": https://repo.zabbix.com/zabbix-official-repo.key