From c92ad0705a73ec4968d9f0c5086ff13feee6438d Mon Sep 17 00:00:00 2001 From: Hiromasa Ihara Date: Wed, 27 Dec 2023 14:37:29 +0900 Subject: [PATCH] Add raspberry pi support --- changelogs/fragments/raspberrypi.yml | 2 ++ roles/zabbix_agent/tasks/Debian.yml | 21 ++++++++++++++++++++- roles/zabbix_agent/vars/Debian.yml | 2 +- roles/zabbix_javagateway/tasks/Debian.yml | 21 ++++++++++++++++++++- roles/zabbix_javagateway/vars/Debian.yml | 2 +- roles/zabbix_proxy/tasks/Debian.yml | 21 ++++++++++++++++++++- roles/zabbix_proxy/vars/Debian.yml | 2 +- roles/zabbix_server/tasks/Debian.yml | 21 ++++++++++++++++++++- roles/zabbix_server/vars/Debian.yml | 2 +- roles/zabbix_web/tasks/Debian.yml | 21 ++++++++++++++++++++- roles/zabbix_web/vars/Debian.yml | 2 +- 11 files changed, 107 insertions(+), 10 deletions(-) create mode 100644 changelogs/fragments/raspberrypi.yml diff --git a/changelogs/fragments/raspberrypi.yml b/changelogs/fragments/raspberrypi.yml new file mode 100644 index 000000000..7b5fd8178 --- /dev/null +++ b/changelogs/fragments/raspberrypi.yml @@ -0,0 +1,2 @@ +bugfixes: + - zabbix-{agent, javagateway, proxy, server, web} - support raspberry pi without repository url specification diff --git a/roles/zabbix_agent/tasks/Debian.yml b/roles/zabbix_agent/tasks/Debian.yml index 35391a56b..6ded0ba03 100644 --- a/roles/zabbix_agent/tasks/Debian.yml +++ b/roles/zabbix_agent/tasks/Debian.yml @@ -8,9 +8,28 @@ tags: - always +- name: "Debian | Installing lsb-release" + ansible.builtin.apt: + pkg: lsb-release + update_cache: true + cache_valid_time: 3600 + force: true + state: present + environment: + http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" + https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" + become: true + tags: + - install + +- name: "Debian | Update ansible_lsb fact" + ansible.builtin.setup: + gather_subset: + - lsb + - name: "Debian | Repo URL" ansible.builtin.set_fact: - zabbix_repo_deb_url: "{{ _zabbix_repo_deb_url }}{{ '-arm64' if ansible_machine == 'aarch64' else ''}}" + zabbix_repo_deb_url: "{{ _zabbix_repo_deb_url }}/{{ ansible_lsb.id.lower() }}{{ '-arm64' if ansible_machine == 'aarch64' and ansible_lsb.id == 'debian' else ''}}" when: - zabbix_repo_deb_url is undefined tags: diff --git a/roles/zabbix_agent/vars/Debian.yml b/roles/zabbix_agent/vars/Debian.yml index 88e566fb4..4a65dfbeb 100644 --- a/roles/zabbix_agent/vars/Debian.yml +++ b/roles/zabbix_agent/vars/Debian.yml @@ -45,4 +45,4 @@ zabbix_valid_agent_versions: debian_keyring_path: /etc/apt/keyrings/ zabbix_gpg_key: "{{ debian_keyring_path }}/zabbix-official-repo.asc" -_zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_agent_version }}/{{ ansible_distribution.lower() }}" +_zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_agent_version }}" diff --git a/roles/zabbix_javagateway/tasks/Debian.yml b/roles/zabbix_javagateway/tasks/Debian.yml index e60dee8fa..4c4cff06d 100644 --- a/roles/zabbix_javagateway/tasks/Debian.yml +++ b/roles/zabbix_javagateway/tasks/Debian.yml @@ -5,9 +5,28 @@ tags: - always +- name: "Debian | Installing lsb-release" + ansible.builtin.apt: + pkg: lsb-release + update_cache: true + cache_valid_time: 3600 + force: true + state: present + environment: + http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" + https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" + become: true + tags: + - install + +- name: "Debian | Update ansible_lsb fact" + ansible.builtin.setup: + gather_subset: + - lsb + - name: "Debian | Repo URL" ansible.builtin.set_fact: - zabbix_repo_deb_url: "{{ _zabbix_repo_deb_url }}{{ '-arm64' if ansible_machine == 'aarch64' else ''}}" + zabbix_repo_deb_url: "{{ _zabbix_repo_deb_url }}/{{ ansible_lsb.id.lower() }}{{ '-arm64' if ansible_machine == 'aarch64' and ansible_lsb.id == 'debian' else ''}}" when: - zabbix_repo_deb_url is undefined tags: diff --git a/roles/zabbix_javagateway/vars/Debian.yml b/roles/zabbix_javagateway/vars/Debian.yml index 544e33094..2253f5b7b 100644 --- a/roles/zabbix_javagateway/vars/Debian.yml +++ b/roles/zabbix_javagateway/vars/Debian.yml @@ -27,4 +27,4 @@ zabbix_valid_javagateway_versions: debian_keyring_path: /etc/apt/keyrings/ zabbix_gpg_key: "{{ debian_keyring_path }}/zabbix-official-repo.asc" -_zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_javagateway_version }}/{{ ansible_distribution.lower() }}" +_zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_javagateway_version }}" diff --git a/roles/zabbix_proxy/tasks/Debian.yml b/roles/zabbix_proxy/tasks/Debian.yml index 07a26e16f..8e27e7d27 100644 --- a/roles/zabbix_proxy/tasks/Debian.yml +++ b/roles/zabbix_proxy/tasks/Debian.yml @@ -7,9 +7,28 @@ tags: - always +- name: "Debian | Installing lsb-release" + ansible.builtin.apt: + pkg: lsb-release + update_cache: true + cache_valid_time: 3600 + force: true + state: present + environment: + http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" + https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" + become: true + tags: + - install + +- name: "Debian | Update ansible_lsb fact" + ansible.builtin.setup: + gather_subset: + - lsb + - name: "Debian | Repo URL" ansible.builtin.set_fact: - zabbix_repo_deb_url: "{{ _zabbix_repo_deb_url }}{{ '-arm64' if ansible_machine == 'aarch64' else ''}}" + zabbix_repo_deb_url: "{{ _zabbix_repo_deb_url }}/{{ ansible_lsb.id.lower() }}{{ '-arm64' if ansible_machine == 'aarch64' and ansible_lsb.id == 'debian' else ''}}" when: - zabbix_repo_deb_url is undefined tags: diff --git a/roles/zabbix_proxy/vars/Debian.yml b/roles/zabbix_proxy/vars/Debian.yml index 182b1109a..cd9527eb2 100644 --- a/roles/zabbix_proxy/vars/Debian.yml +++ b/roles/zabbix_proxy/vars/Debian.yml @@ -52,6 +52,6 @@ mysql_plugin: debian_keyring_path: /etc/apt/keyrings/ zabbix_gpg_key: "{{ debian_keyring_path }}/zabbix-official-repo.asc" -_zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_proxy_version }}/{{ ansible_distribution.lower() }}" +_zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_proxy_version }}" _zabbix_proxy_fping6location: /usr/bin/fping6 _zabbix_proxy_fpinglocation: /usr/bin/fping diff --git a/roles/zabbix_server/tasks/Debian.yml b/roles/zabbix_server/tasks/Debian.yml index 6f8f0f404..ccfe6f121 100644 --- a/roles/zabbix_server/tasks/Debian.yml +++ b/roles/zabbix_server/tasks/Debian.yml @@ -7,9 +7,28 @@ tags: - always +- name: "Debian | Installing lsb-release" + ansible.builtin.apt: + pkg: lsb-release + update_cache: true + cache_valid_time: 3600 + force: true + state: present + environment: + http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" + https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" + become: true + tags: + - install + +- name: "Debian | Update ansible_lsb fact" + ansible.builtin.setup: + gather_subset: + - lsb + - name: "Debian | Repo URL" ansible.builtin.set_fact: - zabbix_repo_deb_url: "{{ _zabbix_repo_deb_url }}{{ '-arm64' if ansible_machine == 'aarch64' else ''}}" + zabbix_repo_deb_url: "{{ _zabbix_repo_deb_url }}/{{ ansible_lsb.id.lower() }}{{ '-arm64' if ansible_machine == 'aarch64' and ansible_lsb.id == 'debian' else ''}}" when: - zabbix_repo_deb_url is undefined tags: diff --git a/roles/zabbix_server/vars/Debian.yml b/roles/zabbix_server/vars/Debian.yml index 2b566e8a1..4074869e6 100644 --- a/roles/zabbix_server/vars/Debian.yml +++ b/roles/zabbix_server/vars/Debian.yml @@ -30,6 +30,6 @@ zabbix_valid_server_versions: debian_keyring_path: /etc/apt/keyrings/ zabbix_gpg_key: "{{ debian_keyring_path }}/zabbix-official-repo.asc" -_zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_server_version }}/{{ ansible_distribution.lower() }}" +_zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_server_version }}" _zabbix_server_fping6location: /usr/bin/fping6 _zabbix_server_fpinglocation: /usr/bin/fping diff --git a/roles/zabbix_web/tasks/Debian.yml b/roles/zabbix_web/tasks/Debian.yml index 3274839b1..ae1c7de26 100644 --- a/roles/zabbix_web/tasks/Debian.yml +++ b/roles/zabbix_web/tasks/Debian.yml @@ -13,9 +13,28 @@ tags: - always +- name: "Debian | Update ansible_lsb fact" + ansible.builtin.setup: + gather_subset: + - lsb + +- name: "Debian | Installing lsb-release" + ansible.builtin.apt: + pkg: lsb-release + update_cache: true + cache_valid_time: 3600 + force: true + state: present + environment: + http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" + https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" + become: true + tags: + - install + - name: "Debian | Repo URL" ansible.builtin.set_fact: - zabbix_repo_deb_url: "{{ _zabbix_repo_deb_url }}{{ '-arm64' if ansible_machine == 'aarch64' else ''}}" + zabbix_repo_deb_url: "{{ _zabbix_repo_deb_url }}/{{ ansible_lsb.id.lower() }}{{ '-arm64' if ansible_machine == 'aarch64' and ansible_lsb.id == 'debian' else ''}}" when: - zabbix_repo_deb_url is undefined tags: diff --git a/roles/zabbix_web/vars/Debian.yml b/roles/zabbix_web/vars/Debian.yml index 0eaaee8b8..7b60c70bd 100644 --- a/roles/zabbix_web/vars/Debian.yml +++ b/roles/zabbix_web/vars/Debian.yml @@ -48,4 +48,4 @@ zabbix_valid_web_versions: debian_keyring_path: /etc/apt/keyrings/ zabbix_gpg_key: "{{ debian_keyring_path }}/zabbix-official-repo.asc" -_zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_web_version }}/{{ ansible_distribution.lower() }}" +_zabbix_repo_deb_url: "http://repo.zabbix.com/zabbix/{{ zabbix_web_version }}"