- name: install collectd-rabbitmq
  package:
    state: present
    name: python3-collectd-rabbitmq-monitoring
  tags:
  - packages
  - collectd

- name: install collectd-python
  package:
    state: present
    name: collectd-python
  tags:
  - packages
  - collectd

- name: install collectd rabbitmq config
  template:
    src: "rabbitmq.collectd.conf.j2"
    dest: "/etc/collectd.d/rabbitmq.conf"
    owner: root
    group: root
    mode: 0640
  tags:
  - collectd
  - config
  notify: restart collectd

- name: Let collectd talk to the RabbitMQ management interface
  seboolean: name=collectd_tcp_network_connect state=yes persistent=yes
  tags:
  - collectd
