설명 없음
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

collectd.yml 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. - name: Add wheezy-backports to be compatible with Dovecot packages on Debian 7
  2. apt_repository: repo='deb http://http.debian.net/debian wheezy-backports main'
  3. when: ansible_distribution_release == 'wheezy'
  4. tags:
  5. - dependencies
  6. - name: Install collectd dependencies on wheezy from backports
  7. apt: pkg={{ item }} state=installed default_release=wheezy-backports
  8. with_items:
  9. - libcurl4-openssl-dev
  10. - librrd2-dev
  11. - python-dev
  12. when: ansible_distribution_release == 'wheezy'
  13. tags:
  14. - dependencies
  15. - name: Install collectd dependencies on distributions other than wheezy
  16. apt: pkg={{ item }} state=installed
  17. with_items:
  18. - libcurl4-openssl-dev
  19. - librrd2-dev
  20. - python-dev
  21. when: ansible_distribution_release != 'wheezy'
  22. tags:
  23. - dependencies
  24. - name: Download collectd
  25. get_url: url=http://collectd.org/files/collectd-{{collectd_version}}.tar.gz
  26. dest=/root/collectd-{{collectd_version}}.tar.gz
  27. - name: Extract collectd
  28. unarchive: src=/root/collectd-{{collectd_version}}.tar.gz
  29. dest=/root copy=no
  30. creates=/root/collectd-{{collectd_version}}
  31. - name: Build and install collectd
  32. shell: ./configure ; make all ; make install
  33. executable=/bin/bash
  34. chdir=/root/collectd-{{collectd_version}}
  35. creates=/opt/collectd/sbin/collectdmon
  36. - name: Copy collectd init file into place
  37. copy: src=etc_init.d_collectd dest=/etc/init.d/collectd mode=0755
  38. - name: Download collectd-librato plugin
  39. get_url: url=https://github.com/librato/collectd-librato/archive/v{{collectd_librato_version}}.tar.gz
  40. dest=/root/collectd-librato-{{collectd_librato_version}}.tar.gz
  41. when: collectd_librato_email|length > 0
  42. - name: Extract collectd-librato plugin
  43. unarchive: src=/root/collectd-librato-{{collectd_librato_version}}.tar.gz
  44. dest=/root copy=no
  45. creates=/root/collectd-librato-{{collectd_librato_version}}
  46. when: collectd_librato_email|length > 0
  47. - name: Install collectd-librato plugin
  48. command: make install
  49. chdir=/root/collectd-librato-{{collectd_librato_version}}
  50. creates=/opt/collectd-librato-{{collectd_librato_version}}
  51. when: collectd_librato_email|length > 0
  52. - name: Copy collectd configuration file into place
  53. template: src=opt_etc_collectd.conf.j2 dest=/opt/collectd/etc/collectd.conf
  54. notify: restart collectd
  55. - name: Ensure collectd is a system service
  56. service: name=collectd state=started enabled=true