feat: add reinstall zabbix-web

This commit is contained in:
Simon Cornet 2025-07-04 13:30:34 +02:00
commit 5a31a8a735
2 changed files with 43 additions and 9 deletions

View file

@ -1,11 +1,31 @@
---
# install zabbix-web-server
- name: "install zabbix-web-server"
ansible.builtin.apt:
name: "{{ item }}"
state: "present"
update_cache: true
with_items:
- "zabbix-frontend-php"
- "zabbix-apache-conf"
# install zabbix-web
- name: "install zabbix-web"
when: "zabbix_major_version not in zabbix_web_current_version.stdout"
block:
# install zabbix-web - debian
- name: "install zabbix-web"
when: 'ansible_os_family == "Debian"'
block:
# remove old zabbix-web
- name: "remove old zabbix-web"
ansible.builtin.apt:
name: "{{ item }}"
state: "absent"
loop:
- "zabbix-frontend-php"
- "zabbix-apache-conf"
# install zabbix-web
- name: "install zabbix-web"
ansible.builtin.apt:
name: "{{ item }}"
state: "present"
update_cache: true
when: 'ansible_os_family == "Debian"'
loop:
- "zabbix-frontend-php"
- "zabbix-apache-conf"

View file

@ -1,5 +1,19 @@
---
# load variables and collect version information
- name: "include vars and collect versions"
block:
# collect zabbix-web version information
- name: "collect version information"
ansible.builtin.shell:
cmd: "apt list zabbix-apache-conf | head -n 2"
changed_when: false
failed_when: false
ignore_errors: true
register: "zabbix_web_current_version"
# zabbix-web-server install
- name: "zabbix-web-server install"
ansible.builtin.import_tasks: "install.yaml"