{% set elasticsearch__tpl_dependent_configuration = {} %}
{% if (elasticsearch__register_dependent_config|d() and elasticsearch__register_dependent_config.content|d()) %}
{%   set _ = elasticsearch__tpl_dependent_configuration.update(elasticsearch__register_dependent_config.content | b64decode | trim | from_json) %}
{% endif %}
{% if elasticsearch__dependent_role|d() %}
{%   if elasticsearch__dependent_state == 'present' %}
{%     set _ = elasticsearch__tpl_dependent_configuration.update({elasticsearch__dependent_role: elasticsearch__dependent_configuration}) %}
{%   elif elasticsearch__dependent_state == 'absent' %}
{%     set _ = elasticsearch__tpl_dependent_configuration.pop(elasticsearch__dependent_role, None) %}
{%   endif %}
{% endif %}
{{ elasticsearch__tpl_dependent_configuration | to_nice_json }}
