updated zabbix state
This commit is contained in:
parent
f3b1890de2
commit
f0ebf07e34
28
states/zabbix/agent/config.sls
Normal file
28
states/zabbix/agent/config.sls
Normal file
@ -0,0 +1,28 @@
|
||||
---
|
||||
{%- from "zabbix/map.jinja" import zabbix with context %}
|
||||
zabbix_log_dir:
|
||||
file.directory:
|
||||
- name: /var/log/zabbix
|
||||
- user: zabbix
|
||||
- group: zabbix
|
||||
- mode: 755
|
||||
- watch_in:
|
||||
- service: zabbix_agent_service
|
||||
|
||||
zabbix_agent_config:
|
||||
file.managed:
|
||||
- name: /etc/zabbix/zabbix_agentd.conf
|
||||
- source: salt://zabbix/templates/zabbix_agentd.conf.j2
|
||||
- template: jinja
|
||||
- watch_in:
|
||||
- service: zabbix_agent_service
|
||||
|
||||
{% if zabbix.agent.config.TLSPSKFile is iterable %}
|
||||
zabbix_agent_tlspsk_file:
|
||||
file.managed:
|
||||
- name: {{ zabbix.agent.config.TLSPSKFile }}
|
||||
- contents: {{ zabbix.agent.psk }}
|
||||
- create: true
|
||||
- watch_in:
|
||||
- service: zabbix_agent_service
|
||||
{% endif %}
|
5
states/zabbix/agent/init.sls
Normal file
5
states/zabbix/agent/init.sls
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
include:
|
||||
- .install
|
||||
- .config
|
||||
- .service
|
5
states/zabbix/agent/install.sls
Normal file
5
states/zabbix/agent/install.sls
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
{%- from "zabbix/map.jinja" import zabbix with context %}
|
||||
zabbix_agent_pkgs:
|
||||
pkg.latest:
|
||||
- pkgs: {{ zabbix.agent.pkgs }}
|
6
states/zabbix/agent/service.sls
Normal file
6
states/zabbix/agent/service.sls
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
{%- from "zabbix/map.jinja" import zabbix with context %}
|
||||
zabbix_agent_service:
|
||||
service.running:
|
||||
- name: zabbix-agent
|
||||
- enable: true
|
@ -1,7 +0,0 @@
|
||||
---
|
||||
{%- from "zabbix_server/map.jinja" import zabbix_server with context %}
|
||||
zabbix_server-config:
|
||||
file.managed:
|
||||
- name: /etc/zabbix/zabbix_server.conf
|
||||
- source: salt://zabbix_server/templates/zabbix_server.conf.j2
|
||||
- template: jinja
|
@ -1,10 +1,26 @@
|
||||
---
|
||||
zabbix_server:
|
||||
zabbix:
|
||||
server:
|
||||
enabled: false
|
||||
pkgs:
|
||||
- zabbix-frontend-php
|
||||
- zabbix-server-pgsql
|
||||
config:
|
||||
DBHost: zabbix
|
||||
DBName: zabbix
|
||||
DBUser: zabbix
|
||||
DBPassword: zabbix
|
||||
DBUser: zabbix
|
||||
LogFile: /var/log/zabbix/zabbix_server.log
|
||||
LogType: file
|
||||
PidFile: /run/zabbix/zabbix_server.pid
|
||||
agent:
|
||||
enabled: true
|
||||
pkgs:
|
||||
- zabbix-agent
|
||||
config:
|
||||
LogFile: /var/log/zabbix/zabbix_agentd.log
|
||||
LogFileSize: 0
|
||||
LogType: file
|
||||
PidFile: /var/run/zabbix/zabbix_agentd.pid
|
||||
Server: 127.0.0.1
|
||||
ServerActive: zabbix.paulbsd.com
|
||||
|
@ -1,8 +1,13 @@
|
||||
---
|
||||
{%- from "zabbix/map.jinja" import zabbix with context %}
|
||||
include:
|
||||
{% if zabbix.server.enabled %}
|
||||
- repos
|
||||
- postgresql
|
||||
- php
|
||||
- .install
|
||||
- .provision
|
||||
- .config
|
||||
- .service
|
||||
- .server
|
||||
{% endif %}
|
||||
{% if zabbix.agent.enabled %}
|
||||
- repos
|
||||
- .agent
|
||||
{% endif %}
|
||||
|
@ -1,5 +0,0 @@
|
||||
---
|
||||
{%- from "zabbix_server/map.jinja" import zabbix_server with context %}
|
||||
zabbix_server_pkgs:
|
||||
pkg.latest:
|
||||
- pkgs: {{ zabbix_server.pkgs }}
|
@ -1,5 +1,5 @@
|
||||
{%- import_yaml "zabbix_server/defaults.yaml" as default_settings -%}
|
||||
{%- import_yaml "zabbix/defaults.yaml" as default_settings -%}
|
||||
|
||||
{%- set defaults = salt['grains.filter_by'](default_settings, default='zabbix_server') -%}
|
||||
{%- set defaults = salt['grains.filter_by'](default_settings, default='zabbix') -%}
|
||||
|
||||
{%- set zabbix_server = salt['pillar.get']('zabbix_server', default=defaults, merge=True) -%}
|
||||
{%- set zabbix = salt['pillar.get']('zabbix', default=defaults, merge=True) -%}
|
||||
|
9
states/zabbix/repo.sls
Normal file
9
states/zabbix/repo.sls
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
{%- from "zabbix/map.jinja" import zabbix with context %}
|
||||
zabbix_repo:
|
||||
pkgrepo.managed:
|
||||
- name: deb {{ zabbix.repo.url }} {{ zabbix.repo.distro }} main
|
||||
- humanname: Zabbix repository
|
||||
- file: /etc/apt/sources.list.d/zabbix.list
|
||||
- keyid: 082AB56BA14FE591
|
||||
- keyserver: keyserver.ubuntu.com
|
7
states/zabbix/server/config.sls
Normal file
7
states/zabbix/server/config.sls
Normal file
@ -0,0 +1,7 @@
|
||||
---
|
||||
{%- from "zabbix/map.jinja" import zabbix with context %}
|
||||
zabbix_server_config:
|
||||
file.managed:
|
||||
- name: /etc/zabbix/zabbix_server.conf
|
||||
- source: salt://zabbix/templates/zabbix_server.conf.j2
|
||||
- template: jinja
|
5
states/zabbix/server/init.sls
Normal file
5
states/zabbix/server/init.sls
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
include:
|
||||
- .install
|
||||
- .config
|
||||
- .service
|
5
states/zabbix/server/install.sls
Normal file
5
states/zabbix/server/install.sls
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
{%- from "zabbix/map.jinja" import zabbix with context %}
|
||||
zabbix_server_pkgs:
|
||||
pkg.latest:
|
||||
- pkgs: {{ zabbix.server.pkgs }}
|
6
states/zabbix/server/service.sls
Normal file
6
states/zabbix/server/service.sls
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
{%- from "zabbix/map.jinja" import zabbix with context %}
|
||||
zabbix_server_service:
|
||||
service.running:
|
||||
- name: zabbix-server
|
||||
- enable: true
|
@ -1,6 +0,0 @@
|
||||
---
|
||||
{%- from "zabbix_server/map.jinja" import zabbix_server with context %}
|
||||
zabbix_server-service:
|
||||
service.running:
|
||||
- name: zabbix-server
|
||||
- enabled: true
|
4
states/zabbix/templates/zabbix_agentd.conf.j2
Normal file
4
states/zabbix/templates/zabbix_agentd.conf.j2
Normal file
@ -0,0 +1,4 @@
|
||||
{%- from "zabbix/map.jinja" import zabbix with context %}
|
||||
{%- for k, v in zabbix.agent.config.items() %}
|
||||
{{ k }}={{ v }}
|
||||
{%- endfor %}
|
@ -1,4 +1,4 @@
|
||||
{%- from "zabbix_server/map.jinja" import zabbix_server with context %}
|
||||
{% for k, v in zabbix_server.config.items() %}
|
||||
{%- from "zabbix/map.jinja" import zabbix with context %}
|
||||
{%- for k, v in zabbix.server.config.items() %}
|
||||
{{ k }}={{ v }}
|
||||
{% endfor %}
|
||||
{%- endfor %}
|
||||
|
Loading…
Reference in New Issue
Block a user