0c29fdfc8f
The default config for collectd is very different between OS distro. For example, in ubuntu, collectd read config from "/etc/collect/collect.conf.d". But in centos, collectd read config from "/etc/collect.d" We need to provide a universal collectd template to make it convenient for different distros. Change-Id: Ib82fcbb923cb32dbafce04e1e639a400d59a4365 Closes-Bug: #1652246
34 lines
936 B
YAML
34 lines
936 B
YAML
---
|
|
- name: Ensuring collectd config directories exist
|
|
file:
|
|
path: "{{ node_config_directory }}/{{ item }}"
|
|
state: "directory"
|
|
recurse: yes
|
|
with_items:
|
|
- "collectd"
|
|
|
|
- name: Ensuring Plugin directory exist
|
|
file:
|
|
path: "{{ node_config_directory }}/{{ item }}/collectd.conf.d"
|
|
state: "directory"
|
|
recurse: yes
|
|
with_items:
|
|
- "collectd"
|
|
|
|
- name: Copying over config.json files for services
|
|
template:
|
|
src: "{{ item }}.json.j2"
|
|
dest: "{{ node_config_directory }}/{{ item }}/config.json"
|
|
with_items:
|
|
- "collectd"
|
|
|
|
- name: Copying over collectd.conf for services
|
|
template:
|
|
src: "{{ item }}"
|
|
dest: "{{ node_config_directory }}/collectd/collectd.conf"
|
|
with_first_found:
|
|
- "{{ node_custom_config }}/collectd/{{ inventory_hostname }}/collectd.conf"
|
|
- "{{ node_custom_config }}/collectd/collectd.conf"
|
|
- "{{ node_custom_config }}/collectd.conf"
|
|
- "collectd.conf.j2"
|