summaryrefslogtreecommitdiff
path: root/roles/monitoring/collectd/base/tasks/main.yml
blob: 90603172c1e6ccf92c15d0f4e6b2cbe8fe1d4536 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
- name: install collectd packages
  apt:
    name: collectd-core
    state: present

- name: install collectd.conf
  template:
    src: collectd.conf.j2
    dest: /etc/collectd/collectd.conf
    mode: 0644
  notify: restart collectd

- name: create conf.d directory
  file:
    path: /etc/collectd/conf.d
    state: directory
  notify: restart collectd

- name: install common config
  template:
    src: common.conf.j2
    dest: /etc/collectd/conf.d/common.conf
    mode: 0644
  notify: restart collectd

- name: install plugin specific config
  loop: "{{ collectd_common_plugin_config | dict2items }}"
  loop_control:
    label: "{{ item.key }}"
  copy:
    dest: "/etc/collectd/conf.d/{{ item.key }}.conf"
    content: |
      <Plugin "{{ item.key }}">
        {{ item.value | indent(width=2) }}
      </Plugin>
  notify: restart collectd