paulbsd-salt/states/zabbix/agent2/config.sls
Paul 56f27dc9d9
All checks were successful
continuous-integration/drone/push Build is passing
updated zabbix state
2024-09-28 14:24:54 +02:00

62 lines
1.6 KiB
Plaintext

---
{%- from "zabbix/map.jinja" import zabbix with context %}
zabbix-config-dir:
file.directory:
- name: /etc/zabbix
- user: {{ zabbix.agent2.user }}
- group: {{ zabbix.agent2.user }}
- mode: 755
- watch_in:
- service: zabbix-agent2-service
zabbix-log-dir:
file.directory:
- name: /var/log/zabbix
- user: {{ zabbix.agent2.user }}
- group: {{ zabbix.agent2.user }}
- mode: 755
- watch_in:
- service: zabbix-agent2-service
zabbix-agent2-config-dir:
file.directory:
- name: /etc/zabbix/zabbix_agent2.d
- user: {{ zabbix.agent2.user }}
- group: {{ zabbix.agent2.user }}
- mode: 755
- watch_in:
- service: zabbix-agent2-service
zabbix-agent2-config:
file.managed:
- name: /etc/zabbix/zabbix_agent2.conf
- user: {{ zabbix.agent2.user }}
- group: {{ zabbix.agent2.user }}
- source: salt://zabbix/templates/zabbix_agent2.conf.j2
- template: jinja
- watch_in:
- service: zabbix-agent2-service
{% if zabbix.agent2.config.TLSPSKFile is iterable %}
zabbix-agent2-tlspsk-file:
file.managed:
- name: {{ zabbix.agent2.config.TLSPSKFile }}
- user: {{ zabbix.agent2.user }}
- group: {{ zabbix.agent2.user }}
- contents: {{ zabbix.agent2.psk }}
- create: true
- watch_in:
- service: zabbix-agent2-service
{% endif %}
zabbix-userparameters:
file.managed:
- name: /etc/zabbix/zabbix_agent2.d/user_parameters.conf
- source: salt://zabbix/templates/user_parameters.j2
- user: {{ zabbix.agent2.user }}
- group: {{ zabbix.agent2.user }}
- mode: 0755
- template: jinja
- watch_in:
- service: zabbix-agent2-service