summaryrefslogtreecommitdiff
path: root/roles/monitoring/collectd/network/server/tasks/main.yml
blob: 63eb9221f4571a6538e0aefd19d87f13bd5e5ad9 (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
38
39
40
---
- name: install network-server config
  template:
    src: network-server.conf.j2
    dest: /etc/collectd/conf.d/network-server.conf
    mode: 0644
  notify: restart collectd

- name: install auth information
  when: collectd_network_server_auth is defined
  copy:
    content: |
      {% for user, password in collectd_network_server_auth.users.items() %}
      {{ user }}: {{ password }}
      {% endfor %}
    dest: /etc/collectd/conf.d/auth_file
    mode: 0400
  notify: restart collectd

- name: install custom types.db
  when: collectd_network_server_custom_types is defined
  block:
  - name: generate custom types.db
    copy:
      content: |+
        {% for name, spec in collectd_network_server_custom_types.items() %}
        {{ name }} {{ spec }}
        {% endfor %}
      dest: /etc/collectd/conf.d/types.db.custom
      mode: 0644
    notify: restart collectd

  - name: enable custom types.db
    copy:
      content: |
        TypesDB "/usr/share/collectd/types.db"
        TypesDB "/etc/collectd/conf.d/types.db.custom"
      dest: /etc/collectd/conf.d/types.conf
      mode: 0644
    notify: restart collectd