diff --git a/states/zabbix/agent/config.sls b/states/zabbix/agent/config.sls index 834e3ba..b28725f 100644 --- a/states/zabbix/agent/config.sls +++ b/states/zabbix/agent/config.sls @@ -1,41 +1,33 @@ --- {%- from "zabbix/map.jinja" import zabbix with context %} -zabbix_config_dir: +zabbix-config-dir: file.directory: - name: /etc/zabbix - user: {{ zabbix.agent.user }} - group: {{ zabbix.agent.user }} - mode: 755 - watch_in: - - service: zabbix_agent_service + - service: zabbix-agent-service -zabbix_log_dir: +zabbix-log-dir: file.directory: - name: /var/log/zabbix - user: {{ zabbix.agent.user }} - group: {{ zabbix.agent.user }} - mode: 755 - watch_in: - - service: zabbix_agent_service + - service: zabbix-agent-service -zabbix_agentd_config_dir: +zabbix-agent-config-dir: file.directory: - name: /etc/zabbix/zabbix_agentd.conf.d - user: {{ zabbix.agent.user }} - group: {{ zabbix.agent.user }} - mode: 755 - watch_in: - - service: zabbix_agent_service + - service: zabbix-agent-service -zabbix_agentd_d_dir: - file.directory: - - name: /etc/zabbix/zabbix_agentd.d - - user: {{ zabbix.agent.user }} - - group: {{ zabbix.agent.user }} - - watch_in: - - service: zabbix_agent_service - -zabbix_agent_config: +zabbix-agent-config: file.managed: - name: /etc/zabbix/zabbix_agentd.conf - user: {{ zabbix.agent.user }} @@ -43,10 +35,10 @@ zabbix_agent_config: - source: salt://zabbix/templates/zabbix_agentd.conf.j2 - template: jinja - watch_in: - - service: zabbix_agent_service + - service: zabbix-agent-service {% if zabbix.agent.config.TLSPSKFile is iterable %} -zabbix_agent_tlspsk_file: +zabbix-agent-tlspsk-file: file.managed: - name: {{ zabbix.agent.config.TLSPSKFile }} - user: {{ zabbix.agent.user }} @@ -54,10 +46,10 @@ zabbix_agent_tlspsk_file: - contents: {{ zabbix.agent.psk }} - create: true - watch_in: - - service: zabbix_agent_service + - service: zabbix-agent-service {% endif %} -zabbix_userparameters: +zabbix-userparameters: file.managed: - name: /etc/zabbix/zabbix_agentd.conf.d/user_parameters.conf - source: salt://zabbix/templates/user_parameters.j2 @@ -66,4 +58,4 @@ zabbix_userparameters: - mode: 0755 - template: jinja - watch_in: - - service: zabbix_agent_service + - service: zabbix-agent-service diff --git a/states/zabbix/agent/install.sls b/states/zabbix/agent/install.sls index 3a9ce87..3b9a9f3 100644 --- a/states/zabbix/agent/install.sls +++ b/states/zabbix/agent/install.sls @@ -1,5 +1,5 @@ --- {%- from "zabbix/map.jinja" import zabbix with context %} -zabbix_agent_pkgs: +zabbix-agent-pkgs: pkg.latest: - pkgs: {{ zabbix.agent.pkgs }} diff --git a/states/zabbix/agent/scripts.sls b/states/zabbix/agent/scripts.sls index fe98723..4b42b49 100644 --- a/states/zabbix/agent/scripts.sls +++ b/states/zabbix/agent/scripts.sls @@ -1,17 +1,17 @@ --- {%- from "zabbix/map.jinja" import zabbix with context %} -zabbix_script_dir: +zabbix-script-dir: file.directory: - name: /etc/zabbix/scripts - user: {{ zabbix.agent.user }} - group: {{ zabbix.agent.group }} -{%- for key, value in zabbix.agent.scripts.items() %} -zabbix_script_{{ key }}: +{% for key, value in zabbix.agent.scripts.items() -%} +zabbix-script-{{ key }}: file.managed: - name: /etc/zabbix/scripts/{{ value.name }} - source: salt://zabbix/scripts/{{ value.name }} - user: {{ zabbix.agent.user }} - group: {{ zabbix.agent.group }} - mode: 0755 -{%- endfor %} +{% endfor -%} diff --git a/states/zabbix/agent/service.sls b/states/zabbix/agent/service.sls index fb76766..09dc869 100644 --- a/states/zabbix/agent/service.sls +++ b/states/zabbix/agent/service.sls @@ -1,6 +1,6 @@ --- {%- from "zabbix/map.jinja" import zabbix with context %} -zabbix_agent_service: +zabbix-agent-service: service.running: - name: zabbix-agent - enable: true diff --git a/states/zabbix/server/config.sls b/states/zabbix/server/config.sls index f9397ba..c1fe28b 100644 --- a/states/zabbix/server/config.sls +++ b/states/zabbix/server/config.sls @@ -1,6 +1,6 @@ --- {%- from "zabbix/map.jinja" import zabbix with context %} -zabbix_server_config: +zabbix-server-config: file.managed: - name: /etc/zabbix/zabbix_server.conf - source: salt://zabbix/templates/zabbix_server.conf.j2 diff --git a/states/zabbix/server/install.sls b/states/zabbix/server/install.sls index dfd74e5..7bcaa73 100644 --- a/states/zabbix/server/install.sls +++ b/states/zabbix/server/install.sls @@ -1,7 +1,7 @@ --- {%- from "zabbix/map.jinja" import zabbix with context %} -zabbix_server_pkgs: +zabbix-server-pkgs: pkg.latest: - pkgs: {{ zabbix.server.pkgs }} - watch_in: - - service: zabbix_server_service + - service: zabbix-server-service diff --git a/states/zabbix/server/service.sls b/states/zabbix/server/service.sls index 5b91044..fd76133 100644 --- a/states/zabbix/server/service.sls +++ b/states/zabbix/server/service.sls @@ -1,6 +1,6 @@ --- {%- from "zabbix/map.jinja" import zabbix with context %} -zabbix_server_service: +zabbix-server-service: service.running: - name: zabbix-server - enable: true diff --git a/states/zabbix/templates/user_parameters.j2 b/states/zabbix/templates/user_parameters.j2 index de7efcc..1e80cf2 100644 --- a/states/zabbix/templates/user_parameters.j2 +++ b/states/zabbix/templates/user_parameters.j2 @@ -1,4 +1,4 @@ {%- from "zabbix/map.jinja" import zabbix with context -%} {%- for userparameter in zabbix.agent.userparameters %} UserParameter={{ userparameter }} -{%- endfor %} +{%- endfor %} \ No newline at end of file diff --git a/states/zabbix/templates/zabbix_agentd.conf.j2 b/states/zabbix/templates/zabbix_agentd.conf.j2 index 836a80b..37b82e0 100644 --- a/states/zabbix/templates/zabbix_agentd.conf.j2 +++ b/states/zabbix/templates/zabbix_agentd.conf.j2 @@ -1,4 +1,4 @@ {%- from "zabbix/map.jinja" import zabbix with context -%} {%- for key, value in zabbix.agent.config.items() %} {{ key }}={{ value }} -{%- endfor %} +{%- endfor %} \ No newline at end of file diff --git a/states/zabbix/templates/zabbix_server.conf.j2 b/states/zabbix/templates/zabbix_server.conf.j2 index 574c82c..f263d9c 100644 --- a/states/zabbix/templates/zabbix_server.conf.j2 +++ b/states/zabbix/templates/zabbix_server.conf.j2 @@ -1,4 +1,4 @@ {%- from "zabbix/map.jinja" import zabbix with context %} {%- for key, value in zabbix.server.config.items() %} {{ key }}={{ value }} -{%- endfor %} +{%- endfor %} \ No newline at end of file