diff --git a/roles/zabbix_web/tasks/nginx.yml b/roles/zabbix_web/tasks/nginx.yml index 1f50263ca..1fa540c18 100644 --- a/roles/zabbix_web/tasks/nginx.yml +++ b/roles/zabbix_web/tasks/nginx.yml @@ -11,35 +11,17 @@ - install - name: "Nginx | Installing Zabbix Nginx Conf" - block: - - name: "Debian | Install zabbix-nginx-conf" - ansible.builtin.apt: - pkg: "zabbix-nginx-conf" - state: "{{ zabbix_web_package_state }}" - update_cache: true - cache_valid_time: 0 - environment: - http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" - https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" - register: zabbix_apache_conf_install - until: zabbix_apache_conf_install is succeeded - become: true - when: ansible_os_family == "Debian" - - - name: "RedHat | Install zabbix-nginx-conf" - ansible.builtin.yum: - name: - - "zabbix-nginx-conf" - state: "{{ zabbix_web_package_state }}" - update_cache: true - disablerepo: "{{ zabbix_agent_disable_repo | default(omit) }}" - environment: - http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" - https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" - register: zabbix_apache_conf_install - until: zabbix_apache_conf_install is succeeded - become: true - when: ansible_os_family == "RedHat" + package: + name: "{{ _zabbix_web_nginx_package }}" + state: "{{ zabbix_web_package_state }}" + update_cache: true + disablerepo: "{{ zabbix_web_disable_repo | default(_zabbix_web_disable_repo | default(omit)) }}" + environment: + http_proxy: "{{ zabbix_http_proxy | default(None) | default(omit) }}" + https_proxy: "{{ zabbix_https_proxy | default(None) | default(omit) }}" + register: zabbix_apache_conf_install + until: zabbix_apache_conf_install is succeeded + become: true tags: - install diff --git a/roles/zabbix_web/vars/Debian.yml b/roles/zabbix_web/vars/Debian.yml index f5fb7337d..891849874 100644 --- a/roles/zabbix_web/vars/Debian.yml +++ b/roles/zabbix_web/vars/Debian.yml @@ -47,3 +47,4 @@ zabbix_valid_web_versions: _zabbix_web_package: zabbix-frontend-php _zabbix_web_apache_package: zabbix-apache-conf +_zabbix_web_nginx_package: zabbix-nginx-conf diff --git a/roles/zabbix_web/vars/RedHat.yml b/roles/zabbix_web/vars/RedHat.yml index 24c87c346..f2a39887a 100644 --- a/roles/zabbix_web/vars/RedHat.yml +++ b/roles/zabbix_web/vars/RedHat.yml @@ -30,5 +30,6 @@ zabbix_valid_web_versions: _zabbix_web_package: "zabbix-web-{{ zabbix_server_database }}-{{ zabbix_web_version }}.{{ zabbix_web_version_minor }}" _zabbix_web_apache_package: "zabbix-apache-conf-{{ zabbix_web_version }}.{{ zabbix_web_version_minor }}" +_zabbix_web_nginx_package: "zabbix-nginx-conf-{{ zabbix_web_version }}.{{ zabbix_web_version_minor }}" _zabbix_web_disable_repo: - epel