--- # tasks file for zabbix - name: check OS version debug: var=ansible_os_family - name: include os variables include_vars: "{{ansible_os_family}}.yml" tags: always - name: Prepare RHEL block: - name: Alma Repo ansible.builtin.shell: cmd: "rpm -Uvh {{repo}}" - name: disable firewall ansible.builtin.service: name: firewalld state: stopped enabled: false - name: clean repo ansible.builtin.shell: cmd: dnf clean all when: ansible_os_family == "RedHat" - name: Prepare Debian block: - name: Debian Repo ansible.builtin.apt: deb: "{{repo}}" - name: Mise à jour le cache des paquets ansible.builtin.apt: update_cache: yes when: ansible_os_family == "Debian" - name: Database - Install when: role == "db" block: - name: Install Zabbix DB ansible.builtin.include_tasks: "{{ansible_os_family}}/install-db.yml" when: role == "db" tags: - install_db - name: Server - Install ansible.builtin.include_tasks: "{{ansible_os_family}}/install-srv.yml" when: role == "srv" tags: - install_srv - name: Proxy - Install ansible.builtin.include_tasks: "{{ansible_os_family}}/install-proxy.yml" tags: - install_proxy when: role == "proxy" - name: Front - Install ansible.builtin.include_tasks: "{{ansible_os_family}}/install-front.yml" when: role == "srv" tags: - install_front - name: Install Agent ansible.builtin.include_tasks: "{{ansible_os_family}}/install-agent2.yml" tags: - install_agent - never