munin.yml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. when_boolean: ${with_munin_node}
  30. - name: Create need directories for munin-node configuration
  31. action: file path=/etc/munin/${item} state=directory owner=root group=root mode=0755
  32. with_items:
  33. - plugins
  34. - plugin-conf.d
  35. when_boolean: ${with_munin_node}
  36. - name: Install munin node configuration
  37. action: template src=munin/munin-node.conf.j2 dest=/etc/munin/munin-node.conf owner=root group=root mode=0644
  38. notify:
  39. - Restart munin-node
  40. when_boolean: ${with_munin_node}
  41. - name: Install munin node plugins configuration
  42. action: template src=munin/munin-node.conf.plugins.j2 dest=/etc/munin/plugin-conf.d/munin-node owner=root group=root mode=0644
  43. notify:
  44. - Restart munin-node
  45. when_boolean: ${with_munin_node}
  46. - name: Autoconfigure munin-node plugins
  47. 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
  48. notify:
  49. - Restart munin-node
  50. when_boolean: ${with_munin_node}
  51. - name: Ensure munin-node is running
  52. action: service name=munin-node state=started
  53. when_boolean: ${with_munin_node}