Commit 5a31a8a7 authored by Simon Cornet's avatar Simon Cornet
Browse files

feat: add reinstall zabbix-web

parent e3e00e20
Loading
Loading
Loading
Loading
Loading
+29 −9
Original line number Diff line number Diff line
---

# install zabbix-web-server
- name: "install zabbix-web-server"
# 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
  with_items:
          when: 'ansible_os_family == "Debian"'
          loop:
            - "zabbix-frontend-php"
            - "zabbix-apache-conf"
+14 −0
Original line number Diff line number Diff line
---

# 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"