Debian Codegraph @

ansible_collections/community/zabbix/roles/zabbix_web/templates/zabbix.conf.php.j2

raw
1 <?php
2 // Zabbix GUI configuration file
3 {% if zabbix_server_history_url is defined %}
4 global $DB, $HISTORY;
5 {% else %}
6 global $DB;
7 {% endif %}
8
9 $DB['TYPE'] = '{{ zabbix_db_type_long | upper() }}';
10 $DB['SERVER'] = '{{ zabbix_server_dbhost }}';
11 $DB['PORT'] = '{{ zabbix_server_dbport }}';
12 $DB['DATABASE'] = '{{ zabbix_server_dbname }}';
13 $DB['USER'] = '{{ zabbix_server_dbuser }}';
14 $DB['PASSWORD'] = '{{ zabbix_server_dbpassword }}';
15 $DB['ENCRYPTION'] = {{ 'true' if zabbix_server_dbencryption else 'false' }};
16 $DB['VERIFY_HOST'] = {{ 'true' if zabbix_server_dbverifyhost else 'false' }};
17
18 // Schema name. Used for IBM DB2 and PostgreSQL.
19 $DB['SCHEMA'] = '{{ zabbix_server_dbschema }}';
20 {% if not zabbix_web_connect_ha_backend %}
21 $ZBX_SERVER = '{{ zabbix_server_hostname }}';
22 $ZBX_SERVER_PORT = '{{ zabbix_server_listenport }}';
23 {% endif %}
24 $ZBX_SERVER_NAME = '{{ zabbix_server_name }}';
25
26 $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
27
28 {% if zabbix_server_history_url is defined %}
29 $HISTORY['url'] = {{ zabbix_server_history_url }};
30 $HISTORY['types'] = {{ zabbix_server_history_types | to_json }};
31 {% endif %}
32
33 {% if zabbix_web_doubleprecision is defined and zabbix_web_doubleprecision %}
34 // Use IEEE754 compatible value range for 64-bit Numeric (float) history values.
35 // This option is enabled by default for new Zabbix installations.
36 // For upgraded installations, please read database upgrade notes before enabling this option.
37 $DB['DOUBLE_IEEE754'] = true;
38 {% endif %}
39
40 {% if zabbix_web_env is defined %}
41 {% for env,val in zabbix_web_env.items() %}
42 putenv("{{env}}={{val}}");
43 {% endfor %}
44 {% endif %}
45
46 {% if zabbix_saml_idp_crt is defined %}
47 $SSO['IDP_CERT'] = '{{ zabbix_saml_idp_crt }}';
48 {% endif %}
49 {% if zabbix_saml_sp_crt is defined %}
50 $SSO['SP_CERT'] = '{{ zabbix_saml_sp_crt }}';
51 {% endif %}
52 {% if zabbix_saml_sp_key is defined %}
53 $SSO['SP_KEY'] = '{{ zabbix_saml_sp_key }}';
54 {% endif %}
55
56 {% if zabbix_server_version is version('7.4', '>=') %}
57 {% if zabbix_server_tls_active is defined and zabbix_server_tls_active == '1' %}
58 {{ (zabbix_server_tls_active is defined and zabbix_server_tls_active is not none) | ternary('', '// ') }}$ZBX_SERVER_TLS['ACTIVE'] = '{{ zabbix_server_tls_active | default('0') }}';
59 {{ (zabbix_server_tls_ca_file is defined and zabbix_server_tls_ca_file is not none) | ternary('', '// ') }}$ZBX_SERVER_TLS['CA_FILE'] = '{{ zabbix_server_tls_ca_file | default('') }}';
60 {{ (zabbix_server_tls_key_file is defined and zabbix_server_tls_key_file is not none) | ternary('', '// ') }}$ZBX_SERVER_TLS['KEY_FILE'] = '{{ zabbix_server_tls_key_file | default('') }}';
61 {{ (zabbix_server_tls_cert_file is defined and zabbix_server_tls_cert_file is not none) | ternary('', '// ') }}$ZBX_SERVER_TLS['CERT_FILE'] = '{{ zabbix_server_tls_cert_file | default('') }}';
62 // Optionally: https://www.zabbix.com/documentation/current/en/manual/appendix/install/frontend_encrypt
63 {{ (zabbix_server_tls_certificate_issuer is defined and zabbix_server_tls_certificate_issuer is not none) | ternary('', '// ') }}$ZBX_SERVER_TLS['CERTIFICATE_ISSUER'] = '{{ zabbix_server_tls_certificate_issuer | default('') }}';
64 {{ (zabbix_server_tls_certificate_subject is defined and zabbix_server_tls_certificate_subject is not none) | ternary('', '// ') }}$ZBX_SERVER_TLS['CERTIFICATE_SUBJECT'] = '{{ zabbix_server_tls_certificate_subject | default('') }}';
65 {% endif %}
66 {% endif %}
67 ?>