Files
configpolicy/roles/collectd/tasks/main.yml
Dustin C. Hatch 3e08588d98 collectd: Configure the processes plugin
The *processes* plugin for collectd can be configured to monitor
additional information about specific processes.  By specifying one or
more `Process` or `ProcessMatch` directives in the plugin configuration,
collectd will start monitoring the listed processes in detail.

The `collectd_processes` Ansible variable can contain a list of
processes to monitor.  Each item must at least have a `name` property,
and may also have a `regex` property.  If the latter is present, a
`ProcessMatch` directive will be emitted instead of a `Process`
directive.
2021-10-16 16:25:02 -05:00

51 lines
1.0 KiB
YAML

- name: load distribution-specific values
include_vars: '{{ item }}'
with_first_found:
- '{{ ansible_distribution }}.yml'
- defaults.yml
tags:
- always
- name: ensure collectd is installed
package:
name: '{{ collectd_packages }}'
state: present
tags:
- install
- name: ensure collectd is configured
template:
src: collectd.conf.j2
dest: /etc/collectd.conf
mode: '0644'
notify:
- restart collectd
tags:
- collectd-config
- name: ensure collectd network plugin is configured
template:
src: collectd-network.conf.j2
dest: /etc/collectd.d/network.conf
mode: '0644'
notify:
- restart collectd
tags:
- collectd-config
- collectd-network
- name: ensure colelctd processes plugin is configured
template:
src: collectd-processes.conf.j2
dest: /etc/collectd.d/processes.conf
mode: '0644'
notify:
- restart collectd
tags:
- collectd-config
- collectd-processes
- name: ensure collectd starts at boot
service:
name: collectd
enabled: true