Skip to content

Instantly share code, notes, and snippets.

Created August 10, 2017 09:45
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/855df0b952afd34b0d26f78c90bc46e6 to your computer and use it in GitHub Desktop.
Save anonymous/855df0b952afd34b0d26f78c90bc46e6 to your computer and use it in GitHub Desktop.
#####DEPLOY ZABBIX AGENT
zabbix_agentd.conf:
file.managed:
- name: /etc/zabbix/zabbix_agentd.conf
- source:
- salt://base/etc/zabbix/zabbix_agentd.conf
- user: root
- group: root
- mode: 644
{% if grains['virtual'] == 'VMware' %}
/etc/zabbix/zabbix_agentd.conf:
file.replace:
- pattern: IPSERVER
- repl: 10.XX.XX.XX
- show_changes: True
- bufsize: file
{% else %}
/etc/zabbix/zabbix_agentd.conf:
file.replace:
- pattern: IPSERVER
- repl: 81.XXX.XXX.XXX.X
- show_changes: True
- bufsize: file
{% endif %}
{% set hostname = grains['host'] %}
hostname_zabbix_agentd.conf:
file.replace:
- name: /etc/zabbix/zabbix_agentd.conf
- pattern: HOSTNAMEAGENT
- repl: {{ hostname }}
- show_changes: True
- bufsize: file
systemctl enable zabbix-agent:
cmd.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment