{# Copyright (C) 2017 Maciej Delmanowski <drybjed@gmail.com>
 # Copyright (C) 2017 DebOps <https://debops.org/>
 # SPDX-License-Identifier: GPL-3.0-only
 #}
{% set kibana__tpl_dependent_configuration = {} %}
{% if (kibana__register_dependent_config|d() and kibana__register_dependent_config.content|d()) %}
{%   set _ = kibana__tpl_dependent_configuration.update(kibana__register_dependent_config.content | b64decode | trim | from_json) %}
{% endif %}
{% if kibana__dependent_role|d() %}
{%   if kibana__dependent_state == 'present' %}
{%     set _ = kibana__tpl_dependent_configuration.update({kibana__dependent_role: kibana__dependent_configuration}) %}
{%   elif kibana__dependent_state == 'absent' %}
{%     set _ = kibana__tpl_dependent_configuration.pop(kibana__dependent_role, None) %}
{%   endif %}
{% endif %}
{{ kibana__tpl_dependent_configuration | to_nice_json }}
