zabbix.yml 996 B

123456789101112131415161718192021222324252627282930313233
  1. - name: Install Zabbix agent
  2. apt: pkg={{ item }} state=installed update_cache=yes
  3. with_items:
  4. - zabbix-agent
  5. when: with_zabbix_agent
  6. - name: Install Zabbix agent config file
  7. template: src='zabbix/agent.conf.j2' dest='/etc/zabbix/zabbix_agentd.conf' owner=root group=root mode=0600
  8. when: with_zabbix_agent
  9. notify:
  10. - Restart zabbix agent
  11. - name: Create zabbix plugins configuration directory
  12. file:
  13. path: '/etc/zabbix/zabbix_plugins.conf.d'
  14. owner: 'root'
  15. group: 'root'
  16. mode: '0755'
  17. state: 'directory'
  18. when: with_zabbix_agent and zabbix_plugins_config
  19. - name: Install zabbix plugins configuration (ssl, web availability, web metrics)
  20. template:
  21. src: 'zabbix/plugins/{{ item }}.j2'
  22. dest: '/etc/zabbix/zabbix_plugins.conf.d/{{ item }}.yml'
  23. owner: 'root'
  24. group: 'root'
  25. mode: '0644'
  26. with_items:
  27. - 'ssl-discovery'
  28. - 'web-metrics-discovery'
  29. - 'web-availability-discovery'
  30. when: with_zabbix_agent and zabbix_plugins_config