| {%- from "collectd/map.jinja" import client with context %} |
| {%- set service_grains = {'collectd': {'plugin': {}}} %} |
| {%- for service_name, service in pillar.items() %} |
| {%- if service.get('_support', {}).get('collectd', {}).get('enabled', False) %} |
| {%- set grains_fragment_file = service_name+'/meta/collectd.yml' %} |
| {%- macro load_grains_file() %}{% include grains_fragment_file %}{% endmacro %} |
| {%- set grains_yaml = load_grains_file()|load_yaml %} |
| {%- set _dummy = service_grains.collectd.plugin.update(grains_yaml.plugin) %} |
| {%- endif %} |
| {%- endfor %} |
| doc: |
| name: collectd |
| description: Collectd is a daemon which collects system performance statistics periodically and provides mechanisms to store the values in a variety of ways, for example in RRD files. |
| role: |
| client: |
| name: client |
| param: |
| {%- for backend_name, backend in client.backend.iteritems() %} |
| backend_{{ backend_name }}: |
| name: {{ backend_name }} writer |
| value: {{ backend.host }}:{{ backend.port }} |
| {%- endfor %} |
| plugins: |
| value: {% for plugin_name, plugin in service_grains.collectd.plugin.iteritems() %} {{ plugin.plugin }}{% endfor %} |