diff --git a/roles/confluence_config/templates/confluence.cfg.xml.j2 b/roles/confluence_config/templates/confluence.cfg.xml.j2
index 1a707eb..04d1130 100644
--- a/roles/confluence_config/templates/confluence.cfg.xml.j2
+++ b/roles/confluence_config/templates/confluence.cfg.xml.j2
@@ -59,11 +59,12 @@
{% endif %}
{# config specific to opensearch #}
{% if atl_opensearch_endpoint is defined and atl_opensearch_endpoint != '' %}
- {% if atl_opensearch_password is defined and atl_opensearch_endpoint = '' %}
- {{ atl_hazelcast_network_aws_iam_region }}
- {% else %}
+ {# if password provided set password and user but NOT region #}
+ {% if atl_opensearch_password is defined and atl_opensearch_password != '' %}
{{ atl_opensearch_password }}
{{ atl_opensearch_user }}
+ {% else %}
+ {{ atl_hazelcast_network_aws_iam_region }}
{% endif %}
https://{{ atl_opensearch_endpoint }}
opensearch