diff options
author | Christian Pointner <equinox@spreadspace.org> | 2020-12-08 01:31:02 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2020-12-08 01:31:02 +0100 |
commit | fe380d3e20467970582a7bdcd850ef101f24431e (patch) | |
tree | c5bff678706f01c92e544439600321fa7799417a /roles/monitoring/collectd/base/tasks | |
parent | kubernetes 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.yml | 37 |
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 |