{%- from "galera/map.jinja" import master, slave with context %} {%- if master.get('enabled', False) %} {%- set service = master %} {%- elif slave.get('enabled', False) %} {%- set service = slave %} {%- endif %} {%- if service is defined %} local_plugin: mysql: template: galera/files/collectd_mysql.conf socket: {{ service.socket }} password: {{ service.admin.password }} username: {{ service.admin.user }} mysql_status: template: galera/files/collectd_mysql_status.conf socket: {{ service.socket }} password: {{ service.admin.password }} username: {{ service.admin.user }} mysql_check: plugin: python template: galera/files/collectd_mysql_check.conf socket: {{ service.socket }} password: {{ service.admin.password }} username: {{ service.admin.user }} {%- endif %}