zabbix.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. - name: 'Install Zabbix agent'
  2. apt:
  3. pkg:
  4. - 'zabbix-agent'
  5. state: 'present'
  6. tags:
  7. - 'monitoring'
  8. - 'zabbix'
  9. - name: 'Install Zabbix agent config file'
  10. template:
  11. src: 'zabbix/agent.conf.j2'
  12. dest: '/etc/zabbix/zabbix_agentd.conf'
  13. owner: 'root'
  14. group: 'root'
  15. mode: '0644'
  16. notify:
  17. - 'Restart zabbix agent'
  18. tags:
  19. - 'monitoring'
  20. - 'zabbix'
  21. - name: 'Create zabbix plugins configuration directory'
  22. file:
  23. path: '/etc/zabbix/zabbix_plugins.conf.d'
  24. owner: 'root'
  25. group: 'root'
  26. mode: '0755'
  27. state: 'directory'
  28. when: zabbix_plugins_config|length > 0
  29. tags:
  30. - 'monitoring'
  31. - 'zabbix'
  32. - name: 'Install zabbix plugins configuration (ssl, web availability)'
  33. template:
  34. src: 'zabbix/plugins/{{ item }}.j2'
  35. dest: '/etc/zabbix/zabbix_plugins.conf.d/{{ item }}.yml'
  36. owner: 'root'
  37. group: 'root'
  38. mode: '0644'
  39. with_items:
  40. - 'ssl-discovery'
  41. - 'web-availability-discovery'
  42. when: zabbix_plugins_config|length > 0
  43. tags:
  44. - 'monitoring'
  45. - 'zabbix'
  46. # vim: ft=yaml.ansible