munin.yml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. - name: Install munin packages
  2. action: ${ansible_pkg_mgr} pkg=munin state=installed update_cache=yes
  3. when_boolean: ${with_munin}
  4. - name: Install munin configuration
  5. action: template src=munin/munin.conf.j2 dest=/etc/munin/munin.conf owner=root group=root mode=0644
  6. when_boolean: ${with_munin}
  7. - name: Create basic authentication file for munin web interface
  8. action: template src=munin/nginx_auth.j2 dest=${munin_http_auth_file} owner=root group=www-data mode=0640
  9. when_boolean: ${with_munin} and ${with_munin_http_auth}
  10. - name: Install munin nginx virtual host (sites-available)
  11. action: template src=munin/nginx_vhost.j2 dest=/etc/nginx/sites-available/munin owner=root group=root mode=0644
  12. notify:
  13. - Reload nginx for munin
  14. when_boolean: ${with_munin}
  15. - name: Install munin nginx virtual host (sites-enabled)
  16. action: file src=/etc/nginx/sites-available/munin path=/etc/nginx/sites-enabled/munin state=link
  17. notify:
  18. - Reload nginx for munin
  19. when_boolean: ${with_munin}
  20. - name: Install munin-node packages
  21. action: ${ansible_pkg_mgr} pkg=${item} state=installed update_cache=yes
  22. with_items:
  23. - munin-node
  24. - munin-plugins-extra
  25. - libnet-cidr-perl
  26. - libcache-cache-perl
  27. - libdbd-pg-perl
  28. - libdbd-mysql-perl
  29. - liblwp-useragent-determined-perl
  30. when_boolean: ${with_munin_node}
  31. - name: Create need directories for munin-node configuration
  32. action: file path=/etc/munin/${item} state=directory owner=root group=root mode=0755
  33. with_items:
  34. - plugins
  35. - plugin-conf.d
  36. when_boolean: ${with_munin_node}
  37. - name: Install munin node configuration
  38. action: template src=munin/munin-node.conf.j2 dest=/etc/munin/munin-node.conf owner=root group=root mode=0644
  39. notify:
  40. - Restart munin-node
  41. when_boolean: ${with_munin_node}
  42. - name: Install munin node plugins configuration
  43. action: template src=munin/munin-node.conf.plugins.j2 dest=/etc/munin/plugin-conf.d/munin-node owner=root group=root mode=0644
  44. notify:
  45. - Restart munin-node
  46. when_boolean: ${with_munin_node}
  47. - name: Autoconfigure munin-node plugins
  48. action: munin_node_autoconf families=auto,manual,contrib excludes=apc_nis,apt,apt_all,port_,ipmi_fans,ipmi_power,ipmi_temp,ntp_,ircu,ntp_kernel_err,ntp_kernel_pll_freq,ntp_kernel_pll_off,ntp_offset,ntp_states
  49. notify:
  50. - Restart munin-node
  51. when_boolean: ${with_munin_node}
  52. - name: Ensure munin-node is running
  53. action: service name=munin-node state=started
  54. when_boolean: ${with_munin_node}