{% set hashicorp__tpl_application_list = ((ansible_local.hashicorp.applications|list if (ansible_local|d() and ansible_local.hashicorp|d() and ansible_local.hashicorp.applications|d()) else []) + hashicorp__applications + hashicorp__dependent_applications) | sort | unique %}
{% set hashicorp__tpl_applications = {} %}
{% for entry in hashicorp__tpl_application_list %}
{%   if (ansible_local|d() and ansible_local.hashicorp|d() and ansible_local.hashicorp.applications|d() and entry in ansible_local.hashicorp.applications) %}
{%     set _ = hashicorp__tpl_applications.update({ entry : ansible_local.hashicorp.applications[entry] }) %}
{%   elif entry in hashicorp__combined_version_map %}
{%     set _ = hashicorp__tpl_applications.update({ entry : hashicorp__combined_version_map[entry] }) %}
{%   endif %}
{%   if (entry in hashicorp__combined_version_map and (hashicorp__tpl_applications[entry] != hashicorp__combined_version_map[entry])) %}
{%     set _ = hashicorp__tpl_applications.update({ entry : hashicorp__combined_version_map[entry] }) %}
{%   endif %}
{% endfor %}
{% set hashicorp__tpl_consul_webui = (ansible_local.hashicorp.consul_webui if (ansible_local|d() and ansible_local.hashicorp|d() and ansible_local.hashicorp.consul_webui|d()) else False) | bool | lower %}
{% if hashicorp__consul_webui | bool and 'consul' in hashicorp__tpl_applications %}
{%   set hashicorp__tpl_consul_webui = True %}
{% endif %}
{% set hashicorp__tpl_facts = {} %}
{% set _ = hashicorp__tpl_facts.update({ "applications":      hashicorp__tpl_applications }) %}
{% set _ = hashicorp__tpl_facts.update({ "bin":               hashicorp__bin }) %}
{% set _ = hashicorp__tpl_facts.update({ "consul_webui":      hashicorp__tpl_consul_webui | bool | lower }) %}
{% set _ = hashicorp__tpl_facts.update({ "consul_webui_path": hashicorp__consul_webui_path }) %}
{% set _ = hashicorp__tpl_facts.update({ "installed":         "true" }) %}
{{ hashicorp__tpl_facts | to_nice_json }}
