munin.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. - name: Install munin packages
  2. apt: pkg=munin state=installed update_cache=yes
  3. when: with_munin
  4. - name: Install munin configuration
  5. template: src=munin/munin.conf.j2 dest=/etc/munin/munin.conf owner=root group=root mode=0644
  6. when: with_munin
  7. - name: Install munin-node packages
  8. apt: pkg={{ item }} state=installed update_cache=yes
  9. with_items:
  10. - munin-node
  11. - munin-plugins-extra
  12. - libnet-cidr-perl
  13. - libcache-cache-perl
  14. - libdbd-pg-perl
  15. - libdbd-mysql-perl
  16. - liblwp-useragent-determined-perl
  17. when: with_munin_node
  18. - name: Create need directories for munin-node configuration
  19. file: path=/etc/munin/{{ item }} state=directory owner=root group=root mode=0755
  20. with_items:
  21. - plugins
  22. - plugin-conf.d
  23. when: with_munin_node
  24. - name: Install munin node configuration
  25. template: src=munin/munin-node.conf.j2 dest=/etc/munin/munin-node.conf owner=root group=root mode=0644
  26. notify:
  27. - Restart munin-node
  28. when: with_munin_node
  29. - name: Install munin node plugins configuration
  30. template: src=munin/munin-node.conf.plugins.j2 dest=/etc/munin/plugin-conf.d/munin-node owner=root group=root mode=0644
  31. notify:
  32. - Restart munin-node
  33. when: with_munin_node
  34. - name: Autoconfigure munin-node plugins
  35. 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
  36. notify:
  37. - Restart munin-node
  38. when: with_munin_node
  39. - name: Install nginx virtual host for munin (sites-available)
  40. template: src=munin/nginx_vhost.j2 dest=/etc/nginx/sites-available/munin owner=root group=root mode=0644
  41. notify:
  42. - Reload nginx for munin
  43. when: with_munin and with_nginx is defined and with_nginx
  44. - name: Install nginx virtual host for munin (sites-enabled)
  45. file: src=/etc/nginx/sites-available/munin path=/etc/nginx/sites-enabled/munin state=link
  46. notify:
  47. - Reload nginx for munin
  48. when: with_munin and with_nginx is defined and with_nginx
  49. - name: Install apache2 virtual host for munin (sites-available)
  50. template: src=munin/apache2_vhost.j2 dest=/etc/apache2/sites-available/munin owner=root group=root mode=0644
  51. notify:
  52. - Reload apache2 for munin
  53. when: with_munin and with_apache2 is defined and with_apache2
  54. - name: Install apache2 virtual host for munin (sites-enabled)
  55. file: src=/etc/apache2/sites-available/munin path=/etc/apache2/sites-enabled/munin state=link
  56. notify:
  57. - Reload apache2 for munin
  58. when: with_munin and with_apache2 is defined and with_apache2
  59. - name: Ensure munin-node is running
  60. service: name=munin-node state=started
  61. when: with_munin_node