{% set elasticsearch__tpl_output = [] %}
{% for plugin in ([ elasticsearch__combined_plugins ] if elasticsearch__combined_plugins is mapping else elasticsearch__combined_plugins) %}
{%   if plugin.state|d('present') != 'absent' %}
{%     if plugin.configuration|d() %}
{%       set _ = elasticsearch__tpl_output.append(plugin.configuration) %}
{%     elif plugin.config|d() %}
{%       set _ = elasticsearch__tpl_output.append(plugin.config) %}
{%     endif %}
{%   endif %}
{% endfor %}
{{ elasticsearch__tpl_output | to_yaml }}
