diff --git a/roles/patroni/templates/patroni.yml.j2 b/roles/patroni/templates/patroni.yml.j2 index 295a6032b..efe5fdd33 100644 --- a/roles/patroni/templates/patroni.yml.j2 +++ b/roles/patroni/templates/patroni.yml.j2 @@ -35,7 +35,8 @@ etcd3: {% endif %} {% if dcs_exists|bool and dcs_type == 'etcd' %} etcd3: - hosts: {% for etcd_hosts in patroni_etcd_hosts %}{{etcd_hosts.host}}:{{etcd_hosts.port}}{% if not loop.last %},{% endif %}{% endfor +%} + hosts: {% for etcd_hosts in patroni_etcd_hosts %}{{etcd_hosts.host}}:{{etcd_hosts.port}}{% if not loop.last %},{% endif %}{% endfor %} + {% if patroni_etcd_username | default('') | length > 0 %} username: {{ patroni_etcd_username | default('') }} {% endif %}