summaryrefslogtreecommitdiff
path: root/roles/monitoring/collectd/base/tasks
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-12-08 01:31:02 +0100
committerChristian Pointner <equinox@spreadspace.org>2020-12-08 01:31:02 +0100
commitfe380d3e20467970582a7bdcd850ef101f24431e (patch)
treec5bff678706f01c92e544439600321fa7799417a /roles/monitoring/collectd/base/tasks
parentkubernetes apt-repo new signging key (diff)
basic collectd role
Diffstat (limited to 'roles/monitoring/collectd/base/tasks')
-rw-r--r--roles/monitoring/collectd/base/tasks/main.yml37
1 files changed, 37 insertions, 0 deletions
diff --git a/roles/monitoring/collectd/base/tasks/main.yml b/roles/monitoring/collectd/base/tasks/main.yml
new file mode 100644
index 00000000..90603172
--- /dev/null
+++ b/roles/monitoring/collectd/base/tasks/main.yml
@@ -0,0 +1,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