zabbix.yml 1017 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. - name: 'Install Zabbix agent'
  2. apt:
  3. pkg: '{{ item }}'
  4. state: 'installed'
  5. update_cache: 'yes'
  6. with_items:
  7. - 'zabbix-agent'
  8. when: with_zabbix_agent
  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: '0600'
  16. when: with_zabbix_agent
  17. notify:
  18. - 'Restart zabbix agent'
  19. - name: 'Create zabbix plugins configuration directory'
  20. file:
  21. path: '/etc/zabbix/zabbix_plugins.conf.d'
  22. owner: 'root'
  23. group: 'root'
  24. mode: '0755'
  25. state: 'directory'
  26. when: with_zabbix_agent and zabbix_plugins_config
  27. - name: 'Install zabbix plugins configuration (ssl, web availability)'
  28. template:
  29. src: 'zabbix/plugins/{{ item }}.j2'
  30. dest: '/etc/zabbix/zabbix_plugins.conf.d/{{ item }}.yml'
  31. owner: 'root'
  32. group: 'root'
  33. mode: '0644'
  34. with_items:
  35. - 'ssl-discovery'
  36. - 'web-availability-discovery'
  37. when: with_zabbix_agent and zabbix_plugins_config