Skip to content

Instantly share code, notes, and snippets.

Created May 17, 2016 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/dbdc9da0fa51589c99e1df62666094c4 to your computer and use it in GitHub Desktop.
Save anonymous/dbdc9da0fa51589c99e1df62666094c4 to your computer and use it in GitHub Desktop.
{% from "packages/zabbix-agent/map.jinja" import our_ips with context %}
{% from "packages/zabbix-agent/map.jinja" import hostname with context %}
{% from "packages/zabbix-agent/map.jinja" import host_group with context %}
{% from "packages/zabbix-agent/map.jinja" import template_1 with context %}
{% from "packages/zabbix-agent/map.jinja" import template_2 with context %}
{% if our_ips %}
{% set our_ip = our_ips[0] %}
{% endif %}
zabbix-agent:
pkg.installed:
- name: zabbix-agent
service:
- running
- enable: True
- order: last
zabbix-agent-conf:
file:
- managed
- name: /etc/zabbix/zabbix_agentd.conf
- user: root
- group: zabbix
- source: salt://packages/zabbix-agent/files/etc_zabbix_zabbix_agentd.conf.jinja
- template: jinja
- mode: 640
- require:
- pkg: zabbix-agent
- watch_in:
- service: zabbix-agent
zabbix-agent-register:
cmd.script:
- source: salt://packages/zabbix-agent/files/zabbix-agent-register.sh
- args: "-l sec1 -h \"{{ hostname }}\" -i \"{{ our_ip }}\" -g \"{{ host_group }}\" -t \"{{ template_1 }}\" -t \"{{ template_2 }}\""
- user: root
- group: root
- shell: /bin/bash
/var/lib/zabbix/scripts:
file.directory:
- user: zabbix
- group: zabbix
- mode: 755
- makedirs: True
- recurse:
- user
- group
- mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment