From 6236037681b09c8c4ed6b02e6d109fd6c9d08e64 Mon Sep 17 00:00:00 2001 From: Jan Tekuelve Date: Fri, 8 Dec 2023 16:14:24 +0100 Subject: [PATCH 01/13] Added zabbix_server_gpg_key_url default variable --- roles/zabbix_server/defaults/main.yml | 1 + roles/zabbix_server/tasks/Debian.yml | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/zabbix_server/defaults/main.yml b/roles/zabbix_server/defaults/main.yml index 6aec202dd..59308e1f3 100644 --- a/roles/zabbix_server/defaults/main.yml +++ b/roles/zabbix_server/defaults/main.yml @@ -61,6 +61,7 @@ zabbix_repo_yum: zabbix_server_apt_priority: zabbix_server_install_recommends: true zabbix_server_conf_mode: 0640 +zabbix_server_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key # Server Configuration Variables (Only ones with role provided defaults) zabbix_server_alertscriptspath: /usr/lib/zabbix/alertscripts diff --git a/roles/zabbix_server/tasks/Debian.yml b/roles/zabbix_server/tasks/Debian.yml index 6f8f0f404..d3afce13c 100644 --- a/roles/zabbix_server/tasks/Debian.yml +++ b/roles/zabbix_server/tasks/Debian.yml @@ -52,10 +52,13 @@ - name: "Debian | Download gpg key" ansible.builtin.get_url: - url: http://repo.zabbix.com/zabbix-official-repo.key + url: "{{ zabbix_server_gpg_key_url }}" dest: "{{ zabbix_gpg_key }}" mode: "0644" force: true + environment: + http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" + https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" register: zabbix_server_repo_files_installed until: zabbix_server_repo_files_installed is succeeded become: true From 327d31d5af6ca29ef7f81fe28e8e7d359c05849b Mon Sep 17 00:00:00 2001 From: Jan Tekuelve Date: Mon, 11 Dec 2023 10:21:08 +0100 Subject: [PATCH 02/13] Added configurable key to proxy and agent. Fixed key path --- roles/zabbix_agent/defaults/main.yml | 2 ++ roles/zabbix_agent/tasks/Debian.yml | 2 +- roles/zabbix_agent/vars/Debian.yml | 2 +- roles/zabbix_javagateway/vars/Debian.yml | 2 +- roles/zabbix_proxy/defaults/main.yml | 2 ++ roles/zabbix_proxy/tasks/Debian.yml | 2 +- roles/zabbix_proxy/vars/Debian.yml | 2 +- roles/zabbix_server/vars/Debian.yml | 2 +- roles/zabbix_web/vars/Debian.yml | 2 +- 9 files changed, 11 insertions(+), 7 deletions(-) diff --git a/roles/zabbix_agent/defaults/main.yml b/roles/zabbix_agent/defaults/main.yml index dbd5db5db..b7d2aec44 100644 --- a/roles/zabbix_agent/defaults/main.yml +++ b/roles/zabbix_agent/defaults/main.yml @@ -26,6 +26,8 @@ zabbix_agent2_deny_key: "{{ zabbix_agent_deny_key }}" # Selinux related vars selinux_allow_zabbix_run_sudo: false +zabbix_agent_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key + zabbix_agent_install_agent_only: false zabbix_agent_packages: - "{{ zabbix_agent_package }}" diff --git a/roles/zabbix_agent/tasks/Debian.yml b/roles/zabbix_agent/tasks/Debian.yml index 35391a56b..34427df52 100644 --- a/roles/zabbix_agent/tasks/Debian.yml +++ b/roles/zabbix_agent/tasks/Debian.yml @@ -47,7 +47,7 @@ - name: "Debian | Download gpg key" ansible.builtin.get_url: - url: http://repo.zabbix.com/zabbix-official-repo.key + url: "{{ zabbix_agent_gpg_key_url }}" dest: "{{ zabbix_gpg_key }}" mode: "0644" force: true diff --git a/roles/zabbix_agent/vars/Debian.yml b/roles/zabbix_agent/vars/Debian.yml index 88e566fb4..c992ca1eb 100644 --- a/roles/zabbix_agent/vars/Debian.yml +++ b/roles/zabbix_agent/vars/Debian.yml @@ -44,5 +44,5 @@ zabbix_valid_agent_versions: - 6.0 debian_keyring_path: /etc/apt/keyrings/ -zabbix_gpg_key: "{{ debian_keyring_path }}/zabbix-official-repo.asc" +zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.gpg" _zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_agent_version }}/{{ ansible_distribution.lower() }}" diff --git a/roles/zabbix_javagateway/vars/Debian.yml b/roles/zabbix_javagateway/vars/Debian.yml index 544e33094..248fc5caa 100644 --- a/roles/zabbix_javagateway/vars/Debian.yml +++ b/roles/zabbix_javagateway/vars/Debian.yml @@ -26,5 +26,5 @@ zabbix_valid_javagateway_versions: - 6.0 debian_keyring_path: /etc/apt/keyrings/ -zabbix_gpg_key: "{{ debian_keyring_path }}/zabbix-official-repo.asc" +zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.gpg" _zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_javagateway_version }}/{{ ansible_distribution.lower() }}" diff --git a/roles/zabbix_proxy/defaults/main.yml b/roles/zabbix_proxy/defaults/main.yml index f46c9c64e..cfdbe72b6 100644 --- a/roles/zabbix_proxy/defaults/main.yml +++ b/roles/zabbix_proxy/defaults/main.yml @@ -38,6 +38,8 @@ zabbix_proxy_tls_config: cert: "certificate" zabbix_proxy_version_minor: "*" +zabbix_proxy_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key + # Yum/APT Variables zabbix_repo_yum_schema: https zabbix_repo_yum_gpgcheck: 0 diff --git a/roles/zabbix_proxy/tasks/Debian.yml b/roles/zabbix_proxy/tasks/Debian.yml index 07a26e16f..8801dea57 100644 --- a/roles/zabbix_proxy/tasks/Debian.yml +++ b/roles/zabbix_proxy/tasks/Debian.yml @@ -53,7 +53,7 @@ - name: "Debian | Download gpg key" ansible.builtin.get_url: - url: http://repo.zabbix.com/zabbix-official-repo.key + url: "{{ zabbix_proxy_gpg_key_url }}" dest: "{{ zabbix_gpg_key }}" mode: "0644" force: true diff --git a/roles/zabbix_proxy/vars/Debian.yml b/roles/zabbix_proxy/vars/Debian.yml index 182b1109a..011072f66 100644 --- a/roles/zabbix_proxy/vars/Debian.yml +++ b/roles/zabbix_proxy/vars/Debian.yml @@ -51,7 +51,7 @@ mysql_plugin: "10": mysql_native_password debian_keyring_path: /etc/apt/keyrings/ -zabbix_gpg_key: "{{ debian_keyring_path }}/zabbix-official-repo.asc" +zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.gpg" _zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_proxy_version }}/{{ ansible_distribution.lower() }}" _zabbix_proxy_fping6location: /usr/bin/fping6 _zabbix_proxy_fpinglocation: /usr/bin/fping diff --git a/roles/zabbix_server/vars/Debian.yml b/roles/zabbix_server/vars/Debian.yml index 2b566e8a1..89cbaf530 100644 --- a/roles/zabbix_server/vars/Debian.yml +++ b/roles/zabbix_server/vars/Debian.yml @@ -29,7 +29,7 @@ zabbix_valid_server_versions: - 6.0 debian_keyring_path: /etc/apt/keyrings/ -zabbix_gpg_key: "{{ debian_keyring_path }}/zabbix-official-repo.asc" +zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.gpg" _zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_server_version }}/{{ ansible_distribution.lower() }}" _zabbix_server_fping6location: /usr/bin/fping6 _zabbix_server_fpinglocation: /usr/bin/fping diff --git a/roles/zabbix_web/vars/Debian.yml b/roles/zabbix_web/vars/Debian.yml index 0eaaee8b8..bf38ced7a 100644 --- a/roles/zabbix_web/vars/Debian.yml +++ b/roles/zabbix_web/vars/Debian.yml @@ -47,5 +47,5 @@ zabbix_valid_web_versions: - 6.0 debian_keyring_path: /etc/apt/keyrings/ -zabbix_gpg_key: "{{ debian_keyring_path }}/zabbix-official-repo.asc" +zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.gpg" _zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_web_version }}/{{ ansible_distribution.lower() }}" From 35a71701ddae6d6e6bf975cd261df860e1fb63d9 Mon Sep 17 00:00:00 2001 From: Jan Tekuelve Date: Mon, 11 Dec 2023 13:47:44 +0100 Subject: [PATCH 03/13] Added changes for zabbix_weg and zabbix_javagateway --- roles/zabbix_javagateway/defaults/main.yml | 2 ++ roles/zabbix_javagateway/tasks/Debian.yml | 2 +- roles/zabbix_web/defaults/main.yml | 2 ++ roles/zabbix_web/tasks/Debian.yml | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/roles/zabbix_javagateway/defaults/main.yml b/roles/zabbix_javagateway/defaults/main.yml index 4356f61a4..7e61999db 100644 --- a/roles/zabbix_javagateway/defaults/main.yml +++ b/roles/zabbix_javagateway/defaults/main.yml @@ -31,3 +31,5 @@ zabbix_javagateway_pidfile: /run/zabbix/zabbix_java_gateway.pid zabbix_javagateway_listenip: 0.0.0.0 zabbix_javagateway_listenport: 10052 zabbix_javagateway_startpollers: 5 + +zabbix_javagateway_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key diff --git a/roles/zabbix_javagateway/tasks/Debian.yml b/roles/zabbix_javagateway/tasks/Debian.yml index e60dee8fa..37a1f9bce 100644 --- a/roles/zabbix_javagateway/tasks/Debian.yml +++ b/roles/zabbix_javagateway/tasks/Debian.yml @@ -28,7 +28,7 @@ - name: "Debian | Download gpg key" ansible.builtin.get_url: - url: http://repo.zabbix.com/zabbix-official-repo.key + url: "{{ zabbix_javagateway_gpg_key_url }}" dest: "{{ zabbix_gpg_key }}" mode: "0644" force: true diff --git a/roles/zabbix_web/defaults/main.yml b/roles/zabbix_web/defaults/main.yml index f37bb07da..ef234c30d 100644 --- a/roles/zabbix_web/defaults/main.yml +++ b/roles/zabbix_web/defaults/main.yml @@ -87,6 +87,8 @@ zabbix_server_history_types: - "dbl" zabbix_selinux: false + +zabbix_web_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key # selinux_allow_zabbix_can_network: false # zabbix_apache_can_connect_ldap: false diff --git a/roles/zabbix_web/tasks/Debian.yml b/roles/zabbix_web/tasks/Debian.yml index 3274839b1..0bbb7257c 100644 --- a/roles/zabbix_web/tasks/Debian.yml +++ b/roles/zabbix_web/tasks/Debian.yml @@ -70,7 +70,7 @@ - name: "Debian | Download gpg key" ansible.builtin.get_url: - url: http://repo.zabbix.com/zabbix-official-repo.key + url: "{{ zabbix_web_gpg_key_url }}" dest: "{{ zabbix_gpg_key }}" mode: "0644" force: true From 44defa72892bc7df9245876c2291738f595fd5d2 Mon Sep 17 00:00:00 2001 From: Jan Tekuelve Date: Mon, 11 Dec 2023 15:00:26 +0100 Subject: [PATCH 04/13] Added Proxy to Key download of remaining roles --- roles/zabbix_javagateway/tasks/Debian.yml | 3 +++ roles/zabbix_proxy/tasks/Debian.yml | 3 +++ roles/zabbix_web/tasks/Debian.yml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/roles/zabbix_javagateway/tasks/Debian.yml b/roles/zabbix_javagateway/tasks/Debian.yml index 37a1f9bce..c5e17e146 100644 --- a/roles/zabbix_javagateway/tasks/Debian.yml +++ b/roles/zabbix_javagateway/tasks/Debian.yml @@ -32,6 +32,9 @@ dest: "{{ zabbix_gpg_key }}" mode: "0644" force: true + environment: + http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" + https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" become: true tags: - install diff --git a/roles/zabbix_proxy/tasks/Debian.yml b/roles/zabbix_proxy/tasks/Debian.yml index 8801dea57..5b16989e0 100644 --- a/roles/zabbix_proxy/tasks/Debian.yml +++ b/roles/zabbix_proxy/tasks/Debian.yml @@ -57,6 +57,9 @@ dest: "{{ zabbix_gpg_key }}" mode: "0644" force: true + environment: + http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" + https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" register: are_zabbix_proxy_dependency_packages_installed until: are_zabbix_proxy_dependency_packages_installed is succeeded become: true diff --git a/roles/zabbix_web/tasks/Debian.yml b/roles/zabbix_web/tasks/Debian.yml index 0bbb7257c..f6945b3e0 100644 --- a/roles/zabbix_web/tasks/Debian.yml +++ b/roles/zabbix_web/tasks/Debian.yml @@ -74,6 +74,9 @@ dest: "{{ zabbix_gpg_key }}" mode: "0644" force: true + environment: + http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" + https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" become: true tags: - install From e54ad4c26ee152755a8da011412edf836facc5c6 Mon Sep 17 00:00:00 2001 From: Jan Tekuelve Date: Thu, 14 Dec 2023 14:07:12 +0100 Subject: [PATCH 05/13] Removed deb-src from sources list. Make configurable, if feasible --- roles/zabbix_agent/tasks/Debian.yml | 2 +- roles/zabbix_javagateway/tasks/Debian.yml | 2 +- roles/zabbix_proxy/tasks/Debian.yml | 2 +- roles/zabbix_server/tasks/Debian.yml | 2 +- roles/zabbix_web/tasks/Debian.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/zabbix_agent/tasks/Debian.yml b/roles/zabbix_agent/tasks/Debian.yml index 34427df52..2e1fb5b71 100644 --- a/roles/zabbix_agent/tasks/Debian.yml +++ b/roles/zabbix_agent/tasks/Debian.yml @@ -65,7 +65,7 @@ group: root mode: 0644 content: | - Types: deb deb-src + Types: deb Enabled: yes URIs: {{ zabbix_repo_deb_url }} Suites: {{ ansible_distribution_release }} diff --git a/roles/zabbix_javagateway/tasks/Debian.yml b/roles/zabbix_javagateway/tasks/Debian.yml index c5e17e146..84a8565c9 100644 --- a/roles/zabbix_javagateway/tasks/Debian.yml +++ b/roles/zabbix_javagateway/tasks/Debian.yml @@ -46,7 +46,7 @@ group: root mode: 0644 content: | - Types: deb deb-src + Types: deb Enabled: yes URIs: {{ zabbix_repo_deb_url }} Suites: {{ ansible_distribution_release }} diff --git a/roles/zabbix_proxy/tasks/Debian.yml b/roles/zabbix_proxy/tasks/Debian.yml index 5b16989e0..fa1625e3f 100644 --- a/roles/zabbix_proxy/tasks/Debian.yml +++ b/roles/zabbix_proxy/tasks/Debian.yml @@ -73,7 +73,7 @@ group: root mode: 0644 content: | - Types: deb deb-src + Types: deb Enabled: yes URIs: {{ zabbix_repo_deb_url }} Suites: {{ ansible_distribution_release }} diff --git a/roles/zabbix_server/tasks/Debian.yml b/roles/zabbix_server/tasks/Debian.yml index d3afce13c..29d469766 100644 --- a/roles/zabbix_server/tasks/Debian.yml +++ b/roles/zabbix_server/tasks/Debian.yml @@ -72,7 +72,7 @@ group: root mode: 0644 content: | - Types: deb deb-src + Types: deb Enabled: yes URIs: {{ zabbix_repo_deb_url }} Suites: {{ ansible_distribution_release }} diff --git a/roles/zabbix_web/tasks/Debian.yml b/roles/zabbix_web/tasks/Debian.yml index f6945b3e0..4729fdf9c 100644 --- a/roles/zabbix_web/tasks/Debian.yml +++ b/roles/zabbix_web/tasks/Debian.yml @@ -88,7 +88,7 @@ group: root mode: 0644 content: | - Types: deb deb-src + Types: deb Enabled: yes URIs: {{ zabbix_repo_deb_url }} Suites: {{ ansible_distribution_release }} From ac5ef8e05f46b8a6ea170b2388db491313fe7ee6 Mon Sep 17 00:00:00 2001 From: Jan Tekuelve Date: Wed, 17 Jan 2024 17:54:09 +0100 Subject: [PATCH 06/13] keyname has to be of asc file type --- roles/zabbix_agent/vars/Debian.yml | 2 +- roles/zabbix_javagateway/vars/Debian.yml | 2 +- roles/zabbix_proxy/vars/Debian.yml | 2 +- roles/zabbix_server/vars/Debian.yml | 2 +- roles/zabbix_web/vars/Debian.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/zabbix_agent/vars/Debian.yml b/roles/zabbix_agent/vars/Debian.yml index c992ca1eb..edb5638d7 100644 --- a/roles/zabbix_agent/vars/Debian.yml +++ b/roles/zabbix_agent/vars/Debian.yml @@ -44,5 +44,5 @@ zabbix_valid_agent_versions: - 6.0 debian_keyring_path: /etc/apt/keyrings/ -zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.gpg" +zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.asc" _zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_agent_version }}/{{ ansible_distribution.lower() }}" diff --git a/roles/zabbix_javagateway/vars/Debian.yml b/roles/zabbix_javagateway/vars/Debian.yml index 248fc5caa..52bce2ac2 100644 --- a/roles/zabbix_javagateway/vars/Debian.yml +++ b/roles/zabbix_javagateway/vars/Debian.yml @@ -26,5 +26,5 @@ zabbix_valid_javagateway_versions: - 6.0 debian_keyring_path: /etc/apt/keyrings/ -zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.gpg" +zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.asc" _zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_javagateway_version }}/{{ ansible_distribution.lower() }}" diff --git a/roles/zabbix_proxy/vars/Debian.yml b/roles/zabbix_proxy/vars/Debian.yml index 011072f66..3b4b6f181 100644 --- a/roles/zabbix_proxy/vars/Debian.yml +++ b/roles/zabbix_proxy/vars/Debian.yml @@ -51,7 +51,7 @@ mysql_plugin: "10": mysql_native_password debian_keyring_path: /etc/apt/keyrings/ -zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.gpg" +zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.asc" _zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_proxy_version }}/{{ ansible_distribution.lower() }}" _zabbix_proxy_fping6location: /usr/bin/fping6 _zabbix_proxy_fpinglocation: /usr/bin/fping diff --git a/roles/zabbix_server/vars/Debian.yml b/roles/zabbix_server/vars/Debian.yml index 89cbaf530..5184c16c6 100644 --- a/roles/zabbix_server/vars/Debian.yml +++ b/roles/zabbix_server/vars/Debian.yml @@ -29,7 +29,7 @@ zabbix_valid_server_versions: - 6.0 debian_keyring_path: /etc/apt/keyrings/ -zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.gpg" +zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.asc" _zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_server_version }}/{{ ansible_distribution.lower() }}" _zabbix_server_fping6location: /usr/bin/fping6 _zabbix_server_fpinglocation: /usr/bin/fping diff --git a/roles/zabbix_web/vars/Debian.yml b/roles/zabbix_web/vars/Debian.yml index bf38ced7a..0a2664abe 100644 --- a/roles/zabbix_web/vars/Debian.yml +++ b/roles/zabbix_web/vars/Debian.yml @@ -47,5 +47,5 @@ zabbix_valid_web_versions: - 6.0 debian_keyring_path: /etc/apt/keyrings/ -zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.gpg" +zabbix_gpg_key: "{{ debian_keyring_path }}zabbix-repo.asc" _zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_web_version }}/{{ ansible_distribution.lower() }}" From 82d77a76f54ef03e0593ef2dd17564452247628b Mon Sep 17 00:00:00 2001 From: Jan Tekuelve Date: Mon, 26 Feb 2024 10:06:31 +0100 Subject: [PATCH 07/13] optionalize deb-src in zabbix.sources --- roles/zabbix_agent/defaults/main.yml | 1 + roles/zabbix_agent/tasks/Debian.yml | 2 +- roles/zabbix_javagateway/defaults/main.yml | 1 + roles/zabbix_javagateway/tasks/Debian.yml | 2 +- roles/zabbix_proxy/defaults/main.yml | 3 ++- roles/zabbix_proxy/tasks/Debian.yml | 2 +- roles/zabbix_server/defaults/main.yml | 1 + roles/zabbix_server/tasks/Debian.yml | 2 +- roles/zabbix_web/defaults/main.yml | 1 + roles/zabbix_web/tasks/Debian.yml | 2 +- 10 files changed, 11 insertions(+), 6 deletions(-) diff --git a/roles/zabbix_agent/defaults/main.yml b/roles/zabbix_agent/defaults/main.yml index b7d2aec44..aca7534e7 100644 --- a/roles/zabbix_agent/defaults/main.yml +++ b/roles/zabbix_agent/defaults/main.yml @@ -27,6 +27,7 @@ zabbix_agent2_deny_key: "{{ zabbix_agent_deny_key }}" selinux_allow_zabbix_run_sudo: false zabbix_agent_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key +zabbix_agent_include_deb_src: true zabbix_agent_install_agent_only: false zabbix_agent_packages: diff --git a/roles/zabbix_agent/tasks/Debian.yml b/roles/zabbix_agent/tasks/Debian.yml index 2e1fb5b71..1a8e59c31 100644 --- a/roles/zabbix_agent/tasks/Debian.yml +++ b/roles/zabbix_agent/tasks/Debian.yml @@ -65,7 +65,7 @@ group: root mode: 0644 content: | - Types: deb + Types: deb{{ ' deb-src' if zabbix_agent_include_deb_src }} Enabled: yes URIs: {{ zabbix_repo_deb_url }} Suites: {{ ansible_distribution_release }} diff --git a/roles/zabbix_javagateway/defaults/main.yml b/roles/zabbix_javagateway/defaults/main.yml index 7e61999db..ee12fddb4 100644 --- a/roles/zabbix_javagateway/defaults/main.yml +++ b/roles/zabbix_javagateway/defaults/main.yml @@ -33,3 +33,4 @@ zabbix_javagateway_listenport: 10052 zabbix_javagateway_startpollers: 5 zabbix_javagateway_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key +zabbix_javagateway_include_deb_src: true diff --git a/roles/zabbix_javagateway/tasks/Debian.yml b/roles/zabbix_javagateway/tasks/Debian.yml index 84a8565c9..486ce32a6 100644 --- a/roles/zabbix_javagateway/tasks/Debian.yml +++ b/roles/zabbix_javagateway/tasks/Debian.yml @@ -46,7 +46,7 @@ group: root mode: 0644 content: | - Types: deb + Types: deb{{ ' deb-src' if zabbix_javagateway_include_deb_src }} Enabled: yes URIs: {{ zabbix_repo_deb_url }} Suites: {{ ansible_distribution_release }} diff --git a/roles/zabbix_proxy/defaults/main.yml b/roles/zabbix_proxy/defaults/main.yml index cfdbe72b6..a5806ca22 100644 --- a/roles/zabbix_proxy/defaults/main.yml +++ b/roles/zabbix_proxy/defaults/main.yml @@ -38,7 +38,6 @@ zabbix_proxy_tls_config: cert: "certificate" zabbix_proxy_version_minor: "*" -zabbix_proxy_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key # Yum/APT Variables zabbix_repo_yum_schema: https @@ -63,6 +62,8 @@ zabbix_repo_yum: state: present zabbix_proxy_apt_priority: zabbix_proxy_package_state: present +zabbix_proxy_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key +zabbix_proxy_include_deb_src: true # Proxy Configuration Variables (Only ones with role provided defaults) zabbix_proxy_allowroot: 0 diff --git a/roles/zabbix_proxy/tasks/Debian.yml b/roles/zabbix_proxy/tasks/Debian.yml index fa1625e3f..29b0b6613 100644 --- a/roles/zabbix_proxy/tasks/Debian.yml +++ b/roles/zabbix_proxy/tasks/Debian.yml @@ -73,7 +73,7 @@ group: root mode: 0644 content: | - Types: deb + Types: deb{{ ' deb-src' if zabbix_proxy_include_deb_src }} Enabled: yes URIs: {{ zabbix_repo_deb_url }} Suites: {{ ansible_distribution_release }} diff --git a/roles/zabbix_server/defaults/main.yml b/roles/zabbix_server/defaults/main.yml index 59308e1f3..73bd3b46d 100644 --- a/roles/zabbix_server/defaults/main.yml +++ b/roles/zabbix_server/defaults/main.yml @@ -62,6 +62,7 @@ zabbix_server_apt_priority: zabbix_server_install_recommends: true zabbix_server_conf_mode: 0640 zabbix_server_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key +zabbix_server_include_deb_src: true # Server Configuration Variables (Only ones with role provided defaults) zabbix_server_alertscriptspath: /usr/lib/zabbix/alertscripts diff --git a/roles/zabbix_server/tasks/Debian.yml b/roles/zabbix_server/tasks/Debian.yml index 29d469766..6de0abcec 100644 --- a/roles/zabbix_server/tasks/Debian.yml +++ b/roles/zabbix_server/tasks/Debian.yml @@ -72,7 +72,7 @@ group: root mode: 0644 content: | - Types: deb + Types: deb{{ ' deb-src' if zabbix_server_include_deb_src }} Enabled: yes URIs: {{ zabbix_repo_deb_url }} Suites: {{ ansible_distribution_release }} diff --git a/roles/zabbix_web/defaults/main.yml b/roles/zabbix_web/defaults/main.yml index ef234c30d..ad613af9a 100644 --- a/roles/zabbix_web/defaults/main.yml +++ b/roles/zabbix_web/defaults/main.yml @@ -89,6 +89,7 @@ zabbix_server_history_types: zabbix_selinux: false zabbix_web_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key +zabbix_web_include_deb_src: true # selinux_allow_zabbix_can_network: false # zabbix_apache_can_connect_ldap: false diff --git a/roles/zabbix_web/tasks/Debian.yml b/roles/zabbix_web/tasks/Debian.yml index 4729fdf9c..106488cde 100644 --- a/roles/zabbix_web/tasks/Debian.yml +++ b/roles/zabbix_web/tasks/Debian.yml @@ -88,7 +88,7 @@ group: root mode: 0644 content: | - Types: deb + Types: deb{{ ' deb-src' if zabbix_web_include_deb_src }} Enabled: yes URIs: {{ zabbix_repo_deb_url }} Suites: {{ ansible_distribution_release }} From 6567d9eff5a00539a5a221fcbd55a28b0a9261ed Mon Sep 17 00:00:00 2001 From: Jan Tekuelve Date: Mon, 26 Feb 2024 10:58:03 +0100 Subject: [PATCH 08/13] added changelog fragment --- changelogs/fragments/custom_gpg_key_url.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelogs/fragments/custom_gpg_key_url.yml diff --git a/changelogs/fragments/custom_gpg_key_url.yml b/changelogs/fragments/custom_gpg_key_url.yml new file mode 100644 index 000000000..af2e5e35c --- /dev/null +++ b/changelogs/fragments/custom_gpg_key_url.yml @@ -0,0 +1,6 @@ +minor_changes: + - agent, javagateway, proxy, server, and web role - introduced default variable zabbix__gpg_key_url with value http://repo.zabbix.com/zabbix-official-repo.key + - agent, javagateway, proxy, server, and web role - used zabbix__gpg_key_url in Debian Task instead of hardcoded url + - agent, javagateway, proxy, server, and web role - introduced default variable zabbix__include_deb_src with value true + - agent, javagateway, proxy, server, and web role - used variable zabbix__include_deb_src in Debian Task to determine whether deb-src should be added to /etc/apt/sources.list.d/zabbix.sources + - agent, javagateway, proxy, server, and web role - removed superfluous slash in zabbix_gpg_key of the Debian vars and renamed key to zabbix-repo instead of zabbix-official-repo From f59ccfb4b1a82465e5c4525774081b42a621cdda Mon Sep 17 00:00:00 2001 From: Jan Tekuelve Date: Mon, 26 Feb 2024 14:16:59 +0100 Subject: [PATCH 09/13] updated changelog fragment --- .../{custom_gpg_key_url.yml => 1186-custom_gpg_key_url.yml} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename changelogs/fragments/{custom_gpg_key_url.yml => 1186-custom_gpg_key_url.yml} (60%) diff --git a/changelogs/fragments/custom_gpg_key_url.yml b/changelogs/fragments/1186-custom_gpg_key_url.yml similarity index 60% rename from changelogs/fragments/custom_gpg_key_url.yml rename to changelogs/fragments/1186-custom_gpg_key_url.yml index af2e5e35c..ba087b6fe 100644 --- a/changelogs/fragments/custom_gpg_key_url.yml +++ b/changelogs/fragments/1186-custom_gpg_key_url.yml @@ -1,6 +1,7 @@ minor_changes: - agent, javagateway, proxy, server, and web role - introduced default variable zabbix__gpg_key_url with value http://repo.zabbix.com/zabbix-official-repo.key - - agent, javagateway, proxy, server, and web role - used zabbix__gpg_key_url in Debian Task instead of hardcoded url + - agent, javagateway, proxy, server, and web role - used zabbix__gpg_key_url in "Debian | Download gpg key" instead of hardcoded url + - agent, javagateway, proxy, server, and web role - added the http_proxy and https_proxy environment variables to "Debian | Download gpg key" analog to other tasks - agent, javagateway, proxy, server, and web role - introduced default variable zabbix__include_deb_src with value true - - agent, javagateway, proxy, server, and web role - used variable zabbix__include_deb_src in Debian Task to determine whether deb-src should be added to /etc/apt/sources.list.d/zabbix.sources + - agent, javagateway, proxy, server, and web role - used variable zabbix__include_deb_src in "Debian | Installing repository" to determine whether deb-src should be added to /etc/apt/sources.list.d/zabbix.sources - agent, javagateway, proxy, server, and web role - removed superfluous slash in zabbix_gpg_key of the Debian vars and renamed key to zabbix-repo instead of zabbix-official-repo From fa553262f44acd20bb8e3e533324335e661558de Mon Sep 17 00:00:00 2001 From: Jan Tekuelve Date: Fri, 1 Mar 2024 10:21:08 +0100 Subject: [PATCH 10/13] adopted zabbix_repo_deb prefix and added readme entries --- changelogs/fragments/1186-custom_gpg_key_url.yml | 9 +++++---- docs/ZABBIX_AGENT_ROLE.md | 2 ++ docs/ZABBIX_JAVAGATEWAY_ROLE.md | 2 ++ docs/ZABBIX_PROXY_ROLE.md | 3 +++ docs/ZABBIX_SERVER_ROLE.md | 2 ++ docs/ZABBIX_WEB_ROLE.md | 2 ++ roles/zabbix_agent/defaults/main.yml | 4 ++-- roles/zabbix_agent/tasks/Debian.yml | 4 ++-- roles/zabbix_javagateway/defaults/main.yml | 4 ++-- roles/zabbix_javagateway/tasks/Debian.yml | 4 ++-- roles/zabbix_proxy/defaults/main.yml | 4 ++-- roles/zabbix_proxy/tasks/Debian.yml | 4 ++-- roles/zabbix_server/defaults/main.yml | 4 ++-- roles/zabbix_server/tasks/Debian.yml | 4 ++-- roles/zabbix_web/defaults/main.yml | 4 ++-- roles/zabbix_web/tasks/Debian.yml | 4 ++-- 16 files changed, 36 insertions(+), 24 deletions(-) diff --git a/changelogs/fragments/1186-custom_gpg_key_url.yml b/changelogs/fragments/1186-custom_gpg_key_url.yml index ba087b6fe..bb4afb1d1 100644 --- a/changelogs/fragments/1186-custom_gpg_key_url.yml +++ b/changelogs/fragments/1186-custom_gpg_key_url.yml @@ -1,7 +1,8 @@ minor_changes: - - agent, javagateway, proxy, server, and web role - introduced default variable zabbix__gpg_key_url with value http://repo.zabbix.com/zabbix-official-repo.key - - agent, javagateway, proxy, server, and web role - used zabbix__gpg_key_url in "Debian | Download gpg key" instead of hardcoded url + - agent, javagateway, proxy, server, and web role - introduced default variable zabbix_repo_deb_gpg_key_url with value http://repo.zabbix.com/zabbix-official-repo.key + - agent, javagateway, proxy, server, and web role - used zabbix_repo_deb_gpg_key_url in "Debian | Download gpg key" instead of hardcoded url - agent, javagateway, proxy, server, and web role - added the http_proxy and https_proxy environment variables to "Debian | Download gpg key" analog to other tasks - - agent, javagateway, proxy, server, and web role - introduced default variable zabbix__include_deb_src with value true - - agent, javagateway, proxy, server, and web role - used variable zabbix__include_deb_src in "Debian | Installing repository" to determine whether deb-src should be added to /etc/apt/sources.list.d/zabbix.sources + - agent, javagateway, proxy, server, and web role - introduced default variable zabbix_repo_deb_include_deb_src with value true + - agent, javagateway, proxy, server, and web role - used variable zabbix_repo_deb_include_deb_src in "Debian | Installing repository" to determine whether deb-src should be added to /etc/apt/sources.list.d/zabbix.sources - agent, javagateway, proxy, server, and web role - removed superfluous slash in zabbix_gpg_key of the Debian vars and renamed key to zabbix-repo instead of zabbix-official-repo + - agent, javagateway, proxy, server, and web role - updated readme with the two new variables "zabbix_repo_deb_gpg_key_url" and "zabbix_repo_deb_include_deb_src" diff --git a/docs/ZABBIX_AGENT_ROLE.md b/docs/ZABBIX_AGENT_ROLE.md index aa73fab3a..d68954bac 100644 --- a/docs/ZABBIX_AGENT_ROLE.md +++ b/docs/ZABBIX_AGENT_ROLE.md @@ -136,6 +136,8 @@ 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_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 1761c7f8b..936192758 100644 --- a/docs/ZABBIX_JAVAGATEWAY_ROLE.md +++ b/docs/ZABBIX_JAVAGATEWAY_ROLE.md @@ -62,6 +62,8 @@ 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_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 baec42155..60771d3eb 100644 --- a/docs/ZABBIX_PROXY_ROLE.md +++ b/docs/ZABBIX_PROXY_ROLE.md @@ -133,6 +133,9 @@ 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_include_deb_src`: True, if deb-src should be included in the zabbix.sources entry. Default 'true'. + ### SElinux * `zabbix_proxy_selinux`: Default: `False`. Enables an SELinux policy so that the Proxy will run. diff --git a/docs/ZABBIX_SERVER_ROLE.md b/docs/ZABBIX_SERVER_ROLE.md index f154f4951..430264b24 100644 --- a/docs/ZABBIX_SERVER_ROLE.md +++ b/docs/ZABBIX_SERVER_ROLE.md @@ -109,6 +109,8 @@ 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_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 5904f8288..2ff7ac703 100644 --- a/docs/ZABBIX_WEB_ROLE.md +++ b/docs/ZABBIX_WEB_ROLE.md @@ -94,6 +94,8 @@ 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_include_deb_src`: True, if deb-src should be included in the zabbix.sources entry. Default 'true'. ### Zabbix Web specific diff --git a/roles/zabbix_agent/defaults/main.yml b/roles/zabbix_agent/defaults/main.yml index aca7534e7..592d27fcf 100644 --- a/roles/zabbix_agent/defaults/main.yml +++ b/roles/zabbix_agent/defaults/main.yml @@ -26,8 +26,8 @@ zabbix_agent2_deny_key: "{{ zabbix_agent_deny_key }}" # Selinux related vars selinux_allow_zabbix_run_sudo: false -zabbix_agent_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key -zabbix_agent_include_deb_src: true +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 zabbix_agent_packages: diff --git a/roles/zabbix_agent/tasks/Debian.yml b/roles/zabbix_agent/tasks/Debian.yml index 1e7158ac5..ca4b73b61 100644 --- a/roles/zabbix_agent/tasks/Debian.yml +++ b/roles/zabbix_agent/tasks/Debian.yml @@ -67,7 +67,7 @@ - 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_agent_gpg_key_url }}" + url: "{{ zabbix_repo_deb_gpg_key_url }}" dest: "{{ zabbix_gpg_key }}" mode: "0644" force: true @@ -85,7 +85,7 @@ group: root mode: 0644 content: | - Types: deb{{ ' deb-src' if zabbix_agent_include_deb_src }} + Types: deb{{ ' deb-src' if zabbix_repo_deb_include_deb_src }} Enabled: yes URIs: {{ zabbix_repo_deb_url }} Suites: {{ ansible_distribution_release }} diff --git a/roles/zabbix_javagateway/defaults/main.yml b/roles/zabbix_javagateway/defaults/main.yml index ee12fddb4..2998423f1 100644 --- a/roles/zabbix_javagateway/defaults/main.yml +++ b/roles/zabbix_javagateway/defaults/main.yml @@ -32,5 +32,5 @@ zabbix_javagateway_listenip: 0.0.0.0 zabbix_javagateway_listenport: 10052 zabbix_javagateway_startpollers: 5 -zabbix_javagateway_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key -zabbix_javagateway_include_deb_src: true +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 d1604e437..743055407 100644 --- a/roles/zabbix_javagateway/tasks/Debian.yml +++ b/roles/zabbix_javagateway/tasks/Debian.yml @@ -48,7 +48,7 @@ - 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_javagateway_gpg_key_url }}" + url: "{{ zabbix_repo_deb_gpg_key_url }}" dest: "{{ zabbix_gpg_key }}" mode: "0644" force: true @@ -66,7 +66,7 @@ group: root mode: 0644 content: | - Types: deb{{ ' deb-src' if zabbix_javagateway_include_deb_src }} + Types: deb{{ ' deb-src' if zabbix_repo_deb_include_deb_src }} Enabled: yes URIs: {{ zabbix_repo_deb_url }} Suites: {{ ansible_distribution_release }} diff --git a/roles/zabbix_proxy/defaults/main.yml b/roles/zabbix_proxy/defaults/main.yml index a5806ca22..32b3254d1 100644 --- a/roles/zabbix_proxy/defaults/main.yml +++ b/roles/zabbix_proxy/defaults/main.yml @@ -62,8 +62,8 @@ zabbix_repo_yum: state: present zabbix_proxy_apt_priority: zabbix_proxy_package_state: present -zabbix_proxy_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key -zabbix_proxy_include_deb_src: true +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) zabbix_proxy_allowroot: 0 diff --git a/roles/zabbix_proxy/tasks/Debian.yml b/roles/zabbix_proxy/tasks/Debian.yml index 1feb5dfe7..83a38c24a 100644 --- a/roles/zabbix_proxy/tasks/Debian.yml +++ b/roles/zabbix_proxy/tasks/Debian.yml @@ -73,7 +73,7 @@ - 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_proxy_gpg_key_url }}" + url: "{{ zabbix_repo_deb_gpg_key_url }}" dest: "{{ zabbix_gpg_key }}" mode: "0644" force: true @@ -93,7 +93,7 @@ group: root mode: 0644 content: | - Types: deb{{ ' deb-src' if zabbix_proxy_include_deb_src }} + Types: deb{{ ' deb-src' if zabbix_repo_deb_include_deb_src }} Enabled: yes URIs: {{ zabbix_repo_deb_url }} Suites: {{ ansible_distribution_release }} diff --git a/roles/zabbix_server/defaults/main.yml b/roles/zabbix_server/defaults/main.yml index 73bd3b46d..2455d4205 100644 --- a/roles/zabbix_server/defaults/main.yml +++ b/roles/zabbix_server/defaults/main.yml @@ -61,8 +61,8 @@ zabbix_repo_yum: zabbix_server_apt_priority: zabbix_server_install_recommends: true zabbix_server_conf_mode: 0640 -zabbix_server_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key -zabbix_server_include_deb_src: true +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) zabbix_server_alertscriptspath: /usr/lib/zabbix/alertscripts diff --git a/roles/zabbix_server/tasks/Debian.yml b/roles/zabbix_server/tasks/Debian.yml index f906146c3..0113db862 100644 --- a/roles/zabbix_server/tasks/Debian.yml +++ b/roles/zabbix_server/tasks/Debian.yml @@ -72,7 +72,7 @@ - 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_server_gpg_key_url }}" + url: "{{ zabbix_repo_deb_gpg_key_url }}" dest: "{{ zabbix_gpg_key }}" mode: "0644" force: true @@ -92,7 +92,7 @@ group: root mode: 0644 content: | - Types: deb{{ ' deb-src' if zabbix_server_include_deb_src }} + Types: deb{{ ' deb-src' if zabbix_repo_deb_include_deb_src }} Enabled: yes URIs: {{ zabbix_repo_deb_url }} Suites: {{ ansible_distribution_release }} diff --git a/roles/zabbix_web/defaults/main.yml b/roles/zabbix_web/defaults/main.yml index ad613af9a..c9a3d51df 100644 --- a/roles/zabbix_web/defaults/main.yml +++ b/roles/zabbix_web/defaults/main.yml @@ -88,8 +88,8 @@ zabbix_server_history_types: zabbix_selinux: false -zabbix_web_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key -zabbix_web_include_deb_src: true +zabbix_repo_deb_gpg_key_url: http://repo.zabbix.com/zabbix-official-repo.key +zabbix_repo_deb_include_deb_src: true # selinux_allow_zabbix_can_network: false # zabbix_apache_can_connect_ldap: false diff --git a/roles/zabbix_web/tasks/Debian.yml b/roles/zabbix_web/tasks/Debian.yml index 67a4dccf0..08ec3fb12 100644 --- a/roles/zabbix_web/tasks/Debian.yml +++ b/roles/zabbix_web/tasks/Debian.yml @@ -90,7 +90,7 @@ - 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_web_gpg_key_url }}" + url: "{{ zabbix_repo_deb_gpg_key_url }}" dest: "{{ zabbix_gpg_key }}" mode: "0644" force: true @@ -108,7 +108,7 @@ group: root mode: 0644 content: | - Types: deb{{ ' deb-src' if zabbix_web_include_deb_src }} + Types: deb{{ ' deb-src' if zabbix_repo_deb_include_deb_src }} Enabled: yes URIs: {{ zabbix_repo_deb_url }} Suites: {{ ansible_distribution_release }} From eb9cdef5c67fd5d2f72e210e43a298e00f7ac201 Mon Sep 17 00:00:00 2001 From: Jan Tekuelve Date: Fri, 1 Mar 2024 10:22:51 +0100 Subject: [PATCH 11/13] fixed quotation marks in readme --- docs/ZABBIX_AGENT_ROLE.md | 2 +- docs/ZABBIX_JAVAGATEWAY_ROLE.md | 2 +- docs/ZABBIX_PROXY_ROLE.md | 2 +- docs/ZABBIX_SERVER_ROLE.md | 2 +- docs/ZABBIX_WEB_ROLE.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/ZABBIX_AGENT_ROLE.md b/docs/ZABBIX_AGENT_ROLE.md index d68954bac..65a34df1d 100644 --- a/docs/ZABBIX_AGENT_ROLE.md +++ b/docs/ZABBIX_AGENT_ROLE.md @@ -137,7 +137,7 @@ The following is an overview of all available configuration default for this rol * `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_include_deb_src`: True, if deb-src should be included in the zabbix.sources entry. Default 'true'. +* `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 936192758..c83e4279f 100644 --- a/docs/ZABBIX_JAVAGATEWAY_ROLE.md +++ b/docs/ZABBIX_JAVAGATEWAY_ROLE.md @@ -63,7 +63,7 @@ The `zabbix_javagateway_version` is optional. The latest available major.minor v * `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_include_deb_src`: True, if deb-src should be included in the zabbix.sources entry. Default 'true'. +* `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 60771d3eb..f4c9922be 100644 --- a/docs/ZABBIX_PROXY_ROLE.md +++ b/docs/ZABBIX_PROXY_ROLE.md @@ -134,7 +134,7 @@ The following is an overview of all available configuration default for this rol * `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_include_deb_src`: True, if deb-src should be included in the zabbix.sources entry. Default 'true'. +* `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 430264b24..9c3139480 100644 --- a/docs/ZABBIX_SERVER_ROLE.md +++ b/docs/ZABBIX_SERVER_ROLE.md @@ -110,7 +110,7 @@ The following is an overview of all available configuration default for this rol * `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_include_deb_src`: True, if deb-src should be included in the zabbix.sources entry. Default 'true'. +* `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 2ff7ac703..91ef7e236 100644 --- a/docs/ZABBIX_WEB_ROLE.md +++ b/docs/ZABBIX_WEB_ROLE.md @@ -95,7 +95,7 @@ The following is an overview of all available configuration defaults for this ro * `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_include_deb_src`: True, if deb-src should be included in the zabbix.sources entry. Default 'true'. +* `zabbix_repo_deb_include_deb_src`: True, if deb-src should be included in the zabbix.sources entry. Default `true`. ### Zabbix Web specific From 1f07fd1bb9790f26e6f3d067e1682d704efbbfb7 Mon Sep 17 00:00:00 2001 From: jtekuelve <153301222+jtekuelve@users.noreply.github.com> Date: Thu, 7 Mar 2024 10:32:12 +0100 Subject: [PATCH 12/13] Update changelogs/fragments/1186-custom_gpg_key_url.yml Co-authored-by: Evgeny --- changelogs/fragments/1186-custom_gpg_key_url.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/changelogs/fragments/1186-custom_gpg_key_url.yml b/changelogs/fragments/1186-custom_gpg_key_url.yml index bb4afb1d1..03c414298 100644 --- a/changelogs/fragments/1186-custom_gpg_key_url.yml +++ b/changelogs/fragments/1186-custom_gpg_key_url.yml @@ -5,4 +5,3 @@ minor_changes: - agent, javagateway, proxy, server, and web role - introduced default variable zabbix_repo_deb_include_deb_src with value true - agent, javagateway, proxy, server, and web role - used variable zabbix_repo_deb_include_deb_src in "Debian | Installing repository" to determine whether deb-src should be added to /etc/apt/sources.list.d/zabbix.sources - agent, javagateway, proxy, server, and web role - removed superfluous slash in zabbix_gpg_key of the Debian vars and renamed key to zabbix-repo instead of zabbix-official-repo - - agent, javagateway, proxy, server, and web role - updated readme with the two new variables "zabbix_repo_deb_gpg_key_url" and "zabbix_repo_deb_include_deb_src" From 0ef0c23d8cd04c73bdc2ebe1734c900d7472add9 Mon Sep 17 00:00:00 2001 From: jtekuelve <153301222+jtekuelve@users.noreply.github.com> Date: Thu, 7 Mar 2024 10:32:18 +0100 Subject: [PATCH 13/13] Update roles/zabbix_proxy/defaults/main.yml Co-authored-by: Evgeny --- roles/zabbix_proxy/defaults/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/roles/zabbix_proxy/defaults/main.yml b/roles/zabbix_proxy/defaults/main.yml index 32b3254d1..07d14eda0 100644 --- a/roles/zabbix_proxy/defaults/main.yml +++ b/roles/zabbix_proxy/defaults/main.yml @@ -38,7 +38,6 @@ zabbix_proxy_tls_config: cert: "certificate" zabbix_proxy_version_minor: "*" - # Yum/APT Variables zabbix_repo_yum_schema: https zabbix_repo_yum_gpgcheck: 0