No Description
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.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. - deps
  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. - deps
  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. - deps
  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. command: tar xzf collectd-{{collectd_version}}.tar.gz
  29. chdir=/root creates=/root/collectd-{{collectd_version}}
  30. - name: Build and install collectd
  31. shell: ./configure ; make all ; make install
  32. executable=/bin/bash
  33. chdir=/root/collectd-{{collectd_version}}
  34. creates=/opt/collectd/sbin/collectdmon
  35. - name: Copy collectd init file into place
  36. copy: src=etc_init.d_collectd dest=/etc/init.d/collectd mode=0755
  37. - name: Download collectd-librato plugin
  38. get_url: url=https://github.com/librato/collectd-librato/archive/v{{collectd_librato_version}}.tar.gz
  39. dest=/root/collectd-librato-{{collectd_librato_version}}.tar.gz
  40. when: collectd_librato_email|length > 0
  41. - name: Extract collectd-librato plugin
  42. command: tar xzf collectd-librato-{{collectd_librato_version}}.tar.gz
  43. chdir=/root creates=/root/collectd-librato-{{collectd_librato_version}}
  44. when: collectd_librato_email|length > 0
  45. - name: Install collectd-librato plugin
  46. command: make install
  47. chdir=/root/collectd-librato-{{collectd_librato_version}}
  48. creates=/opt/collectd-librato-{{collectd_librato_version}}
  49. when: collectd_librato_email|length > 0
  50. - name: Copy collectd configuration file into place
  51. template: src=opt_etc_collectd.conf.j2 dest=/opt/collectd/etc/collectd.conf
  52. notify: restart collectd
  53. - name: Ensure collectd is a system service
  54. service: name=collectd state=started enabled=true