---

- name: Copy in /usr/local/bin/web-service-collectd
  template: >
    src=web-service-collectd.py
    dest="/usr/local/bin/web-service-collectd-{{ site }}"
    mode=0755
  tags:
  - collectd
  notify: restart collectd

- name: Copy in /etc/collectd.d/web-service.conf
  template: >
    src=web-service.conf
    dest=/etc/collectd.d/{{ site }}.conf
  tags:
  - collectd
  notify: restart collectd

- name: Let collectd talk to apache over tcp
  seboolean: name=collectd_tcp_network_connect state=yes persistent=yes
  tags:
  - collectd
  ignore_errors: True
