feat: initial commit

This commit is contained in:
Simon Cornet 2025-06-06 17:12:03 +02:00
commit 1e593545e6
14 changed files with 260 additions and 0 deletions

52
tasks/prerequisites.yaml Normal file
View file

@ -0,0 +1,52 @@
---
# 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 zabbix-release"
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 zabbix-release"
ansible.builtin.zypper:
name: "zabbix-release"
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