munin.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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: Install munin nginx virtual host (sites-available)
  8. action: template src=munin/nginx_vhost.j2 dest=/etc/nginx/sites-available/munin owner=root group=root mode=0644
  9. notify:
  10. - Reload nginx for munin
  11. when_boolean: ${with_munin}
  12. - name: Install munin nginx virtual host (sites-enabled)
  13. action: file src=/etc/nginx/sites-available/munin path=/etc/nginx/sites-enabled/munin state=link
  14. notify:
  15. - Reload nginx for munin
  16. when_boolean: ${with_munin}
  17. - name: Install munin-node packages
  18. action: ${ansible_pkg_mgr} pkg=${item} state=installed update_cache=yes
  19. with_items:
  20. - munin-node
  21. - munin-plugins-extra
  22. - libnet-cidr-perl
  23. - libcache-cache-perl
  24. - libdbd-pg-perl
  25. - libdbd-mysql-perl
  26. when_boolean: ${with_munin_node}
  27. - name: Create need directories for munin-node configuration
  28. action: file path=/etc/munin/${item} state=directory owner=root group=root mode=0755
  29. with_items:
  30. - plugins
  31. - plugin-conf.d
  32. when_boolean: ${with_munin_node}
  33. - name: Install munin node configuration
  34. action: template src=munin/munin-node.conf.j2 dest=/etc/munin/munin-node.conf owner=root group=root mode=0644
  35. notify:
  36. - Restart munin-node
  37. when_boolean: ${with_munin_node}
  38. - name: Install munin node plugins configuration
  39. action: template src=munin/munin-node.conf.plugins.j2 dest=/etc/munin/plugin-conf.d/munin-node owner=root group=root mode=0644
  40. notify:
  41. - Restart munin-node
  42. when_boolean: ${with_munin_node}
  43. - name: Autoconfigure munin-node plugins
  44. 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
  45. notify:
  46. - Restart munin-node
  47. when_boolean: ${with_munin_node}
  48. - name: Ensure munin-node is running
  49. action: service name=munin-node state=started
  50. when_boolean: ${with_munin_node}