paulbsd-salt/states/zabbix/agent/config.sls

62 lines
1.6 KiB
Plaintext
Raw Normal View History

2020-10-25 16:35:57 +01:00
---
{%- from "zabbix/map.jinja" import zabbix with context %}
2021-08-19 19:21:06 +02:00
zabbix-config-dir:
2020-11-04 23:05:21 +01:00
file.directory:
- name: /etc/zabbix
2021-08-16 09:59:37 +02:00
- user: {{ zabbix.agent.user }}
- group: {{ zabbix.agent.user }}
2020-11-04 23:05:21 +01:00
- mode: 755
- watch_in:
2021-08-19 19:21:06 +02:00
- service: zabbix-agent-service
2020-11-04 23:05:21 +01:00
2021-08-19 19:21:06 +02:00
zabbix-log-dir:
2020-10-25 16:35:57 +01:00
file.directory:
- name: /var/log/zabbix
2021-08-16 09:59:37 +02:00
- user: {{ zabbix.agent.user }}
- group: {{ zabbix.agent.user }}
2020-10-25 16:35:57 +01:00
- mode: 755
- watch_in:
2021-08-19 19:21:06 +02:00
- service: zabbix-agent-service
2020-10-25 16:35:57 +01:00
2021-08-19 19:21:06 +02:00
zabbix-agent-config-dir:
2020-11-04 23:05:21 +01:00
file.directory:
- name: /etc/zabbix/zabbix_agentd.conf.d
2021-08-16 09:59:37 +02:00
- user: {{ zabbix.agent.user }}
- group: {{ zabbix.agent.user }}
2020-11-04 23:05:21 +01:00
- mode: 755
- watch_in:
2021-08-19 19:21:06 +02:00
- service: zabbix-agent-service
2020-11-04 23:05:21 +01:00
2021-08-19 19:21:06 +02:00
zabbix-agent-config:
2020-10-25 16:35:57 +01:00
file.managed:
- name: /etc/zabbix/zabbix_agentd.conf
2021-08-16 09:59:37 +02:00
- user: {{ zabbix.agent.user }}
- group: {{ zabbix.agent.user }}
2020-10-25 16:35:57 +01:00
- source: salt://zabbix/templates/zabbix_agentd.conf.j2
- template: jinja
- watch_in:
2021-08-19 19:21:06 +02:00
- service: zabbix-agent-service
2020-10-25 16:35:57 +01:00
{% if zabbix.agent.config.TLSPSKFile is iterable %}
2021-08-19 19:21:06 +02:00
zabbix-agent-tlspsk-file:
2020-10-25 16:35:57 +01:00
file.managed:
- name: {{ zabbix.agent.config.TLSPSKFile }}
2021-08-16 09:59:37 +02:00
- user: {{ zabbix.agent.user }}
- group: {{ zabbix.agent.user }}
2020-10-25 16:35:57 +01:00
- contents: {{ zabbix.agent.psk }}
- create: true
- watch_in:
2021-08-19 19:21:06 +02:00
- service: zabbix-agent-service
2020-10-25 16:35:57 +01:00
{% endif %}
2020-11-04 23:05:21 +01:00
2021-08-19 19:21:06 +02:00
zabbix-userparameters:
2020-11-04 23:05:21 +01:00
file.managed:
- name: /etc/zabbix/zabbix_agentd.conf.d/user_parameters.conf
- source: salt://zabbix/templates/user_parameters.j2
2021-08-16 09:59:37 +02:00
- user: {{ zabbix.agent.user }}
- group: {{ zabbix.agent.user }}
2020-11-04 23:05:21 +01:00
- mode: 0755
- template: jinja
- watch_in:
2021-08-19 19:21:06 +02:00
- service: zabbix-agent-service