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

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