zabbix-agent/tasks/prerequisites.yaml

52 lines
1.4 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_os_family == "Debian"'
block:
- name: "remove old version"
ansible.builtin.apt:
name: "zabbix-release"
state: "absent"
purge: true
- name: "install zabbix-release"
ansible.builtin.apt:
deb: "{{ zabbix_repo_url[ansible_distribution][ansible_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_os_family == "Suse"'
block:
- name: "remove old version"
ansible.builtin.zypper:
name: "zabbix-releas"
state: "absent"
- name: "install zabbix-release"
ansible.builtin.zypper:
name: "{{ zabbix_repo_url[ansible_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