Update to 2020-12-07 16:00

master
Daniel Berteaud 3 years ago
parent 4a3a9b3505
commit 3671f7ac56
  1. 6
      roles/zabbix_proxy/defaults/main.yml
  2. 35
      roles/zabbix_proxy/tasks/service.yml
  3. 5
      roles/zabbix_server/defaults/main.yml
  4. 35
      roles/zabbix_server/tasks/service.yml

@ -17,4 +17,10 @@ zabbix_proxy_cache_size: 32M
# If update is set to False, the role will only ensure packages are installed
# If set to True, it will update components to their latest version
zabbix_proxy_update: False
# You might want to ignore system proxy for Zabbix proxy itself,
# so its web monitoring can be direct
# This will only have an effect if system_proxy is defined
zabbix_proxy_uses_system_proxy: True
...

@ -1,5 +1,40 @@
---
- name: Remove custom unit
file: path=/etc/systemd/system/zabbix-proxy.service state=absent
register: zabbix_proxy_custom_unit
notify: restart zabbix-proxy
tags: zabbix
- name: Create unit snippet dir
file: path=/etc/systemd/system/zabbix-proxy.service.d state=directory
tags: zabbix
- name: Customize systemd unit
copy:
content: |
[Service]
ExecReload=/usr/sbin/zabbix_proxy -R config_cache_reload
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=full
ProtectHome=yes
{% if not zabbix_proxy_uses_system_proxy %}
# Disable system proxy
{% for proto in ['http_proxy','https_proxy','HTTP_PROXY','HTTPS_PROXY'] %}
Environment={{ proto }}=
{% endfor %}
{% endif %}
dest: /etc/systemd/system/zabbix-proxy.service.d/99-ansible.conf
register: zabbix_proxy_snippet_unit
notify: restart zabbix-proxy
tags: zabbix
- name: Reload systemd
systemd: daemon_reload=True
when: zabbix_proxy_custom_unit.changed or zabbix_proxy_snippet_unit.changed
tags: zabbix
- name: Start and enable the service
service: name=zabbix-proxy state=started enabled=True
register: zabbix_proxy_started

@ -55,3 +55,8 @@ zabbix_server_auth_http: False
# pre-backup will skip history tables from the dump. Except if called with
# pre-backup full
zabbix_server_backup_on_full_only: False
# You might want to ignore system proxy for Zabbix server itself,
# so its web monitoring can be direct
# This will only have an effect if system_proxy is defined
zabbix_server_uses_system_proxy: True

@ -1,5 +1,40 @@
---
- name: Remove custom unit
file: path=/etc/systemd/system/zabbix-server.service state=absent
register: zabbix_server_custom_unit
notify: restart zabbix-server
tags: zabbix
- name: Create unit snippet dir
file: path=/etc/systemd/system/zabbix-server.service.d state=directory
tags: zabbix
- name: Customize systemd unit
copy:
content: |
[Service]
ExecReload=/usr/sbin/zabbix_server -R config_cache_reload
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=full
ProtectHome=yes
{% if not zabbix_server_uses_system_proxy %}
# Disable system proxy
{% for proto in ['http_proxy','https_proxy','HTTP_PROXY','HTTPS_PROXY'] %}
Environment={{ proto }}=
{% endfor %}
{% endif %}
dest: /etc/systemd/system/zabbix-server.service.d/99-ansible.conf
register: zabbix_server_snippet_unit
notify: restart zabbix-server
tags: zabbix
- name: Reload systemd
systemd: daemon_reload=True
when: zabbix_server_custom_unit.changed or zabbix_server_snippet_unit.changed
tags: zabbix
- name: Start and enable the service
service: name=zabbix-server state=started enabled=True
register: zabbix_server_started

Loading…
Cancel
Save