Debian Codegraph @

ansible_collections/community/zabbix/roles/zabbix_web/tasks/nginx.yml

raw
1 ---
2 - name: "Nginx | Set websrv specific variables"
3 ansible.builtin.set_fact:
4 zabbix_web_user: "{{ zabbix_web_user if zabbix_web_user is defined else _nginx_user }}"
5 zabbix_web_group: "{{ zabbix_web_group if zabbix_web_group is defined else _nginx_group }}"
6 zabbix_web_vhost_location: "{{ zabbix_web_vhost_location if zabbix_web_vhost_location is defined else _nginx_vhost_location }}"
7 zabbix_nginx_log_path: "{{ zabbix_nginx_log_path if zabbix_nginx_log_path is defined else _nginx_log_path }}"
8 zabbix_nginx_service: "{{ zabbix_nginx_service if zabbix_nginx_service is defined else _nginx_service }}"
9 tags:
10 - config
11 - install
12
13 - name: "Nginx | Installing Zabbix Nginx Conf"
14 package:
15 name: "{{ _zabbix_web_nginx_packages + _zabbix_web_nginx_php_dependencies | default([]) }}"
16 state: "{{ zabbix_web_package_state }}"
17 update_cache: true
18 disablerepo: "{{ zabbix_web_disable_repo | default(_zabbix_web_disable_repo | default(omit)) }}"
19 environment:
20 http_proxy: "{{ zabbix_http_proxy | default('') }}"
21 https_proxy: "{{ zabbix_https_proxy | default('') }}"
22 register: zabbix_nginx_conf_install
23 until: zabbix_nginx_conf_install is succeeded
24 become: true
25 tags:
26 - install
27
28 - name: "Nginx | Install vhost in conf.d"
29 ansible.builtin.template:
30 src: nginx_vhost.conf.j2
31 dest: "{{ zabbix_web_vhost_location }}"
32 owner: "{{ zabbix_web_user }}"
33 group: "{{ zabbix_web_group }}"
34 mode: 0644
35 when:
36 - zabbix_web_create_vhost
37 become: true
38 notify:
39 - restart nginx
40 tags:
41 - config