zabbix-prereq/tasks/prerequisites.yaml
Simon Cornet 93eff096e6
All checks were successful
ci/woodpecker/push/linting Pipeline was successful
fix: line-lenght issue
2026-05-19 09:22:11 +02:00

53 lines
1.5 KiB
YAML

---
# install repository
- name: "install repository"
when: "zabbix_major_version not in zabbix_current_version.stdout"
block:
# install repository - debian
- name: "install repository"
when: 'ansible_facts["os_family"] == "Debian"'
block:
- name: "remove old zabbix-release"
ansible.builtin.apt:
name: "zabbix-release"
state: "absent"
purge: true
- name: "install zabbix-release"
ansible.builtin.apt:
deb:
"{{ zabbix_repo_url[ansible_facts['distribution']][ansible_facts['distribution_major_version'] | int] }}"
state: "present"
force: true
- name: "refresh apt cache"
ansible.builtin.apt:
update_cache: true
# install repository - suse
- name: "install repository"
when: 'ansible_facts["os_family"] == "Suse"'
block:
- name: "remove old zabbix-release"
ansible.builtin.zypper:
name: "zabbix-release"
state: "absent"
- name: "install zabbix-release"
ansible.builtin.zypper:
name: "{{ zabbix_repo_url[ansible_facts['distribution_major_version'] | int] }}"
state: "present"
disable_recommends: false
nosignature: true
validate_certs: true
- name: "import gpg key"
community.general.zypper_repository:
name: "Zabbix Official Repository"
auto_import_keys: true
runrefresh: true