Skip to content

Commit

Permalink
Update condition for _direct vars
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks committed Jan 12, 2024
1 parent 3ff643a commit 1604ea7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions roles/confd/templates/haproxy.tmpl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ listen master
{{end}}{% endraw %}
{% endif %}

{% if pgbouncer_install|bool and haproxy_listen_port.master_direct | default('') | length > 0 %}
{% if pgbouncer_install|bool and haproxy_listen_port.master_direct is defined %}
listen master_direct
{% if cluster_vip is defined and cluster_vip | length > 0 %}
bind {{ cluster_vip }}:{{ haproxy_listen_port.master_direct }}
Expand Down Expand Up @@ -82,7 +82,7 @@ listen replicas
{{end}}{% endraw %}
{% endif %}

{% if pgbouncer_install|bool and haproxy_listen_port.replicas_direct | default('') | length > 0 %}
{% if pgbouncer_install|bool and haproxy_listen_port.replicas_direct is defined %}
listen replicas_direct
{% if cluster_vip is defined and cluster_vip | length > 0 %}
bind {{ cluster_vip }}:{{ haproxy_listen_port.replicas_direct }}
Expand Down Expand Up @@ -120,7 +120,7 @@ listen replicas_sync
{{end}}{% endraw %}
{% endif %}

{% if pgbouncer_install|bool and haproxy_listen_port.replicas_sync_direct | default('') | length > 0 %}
{% if pgbouncer_install|bool and haproxy_listen_port.replicas_sync_direct is defined %}
listen replicas_sync_direct
{% if cluster_vip is defined and cluster_vip | length > 0 %}
bind {{ cluster_vip }}:{{ haproxy_listen_port.replicas_sync_direct }}
Expand Down Expand Up @@ -158,7 +158,7 @@ listen replicas_async
{{end}}{% endraw %}
{% endif %}

{% if pgbouncer_install|bool and haproxy_listen_port.replicas_async_direct | default('') | length > 0 %}
{% if pgbouncer_install|bool and haproxy_listen_port.replicas_async_direct is defined %}
listen replicas_async_direct
{% if cluster_vip is defined and cluster_vip | length > 0 %}
bind {{ cluster_vip }}:{{ haproxy_listen_port.replicas_async_direct }}
Expand Down
8 changes: 4 additions & 4 deletions roles/haproxy/templates/haproxy.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['inventory_hos
{% endfor %}
{% endif %}

{% if pgbouncer_install|bool and haproxy_listen_port.master_direct | default('') | length > 0 %}
{% if pgbouncer_install|bool and haproxy_listen_port.master_direct is defined %}
listen master_direct
{% if cluster_vip is defined and cluster_vip | length > 0 %}
bind {{ cluster_vip }}:{{ haproxy_listen_port.master_direct }}
Expand Down Expand Up @@ -87,7 +87,7 @@ server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['inventory_hos
{% endfor %}
{% endif %}

{% if pgbouncer_install|bool and haproxy_listen_port.replicas_direct | default('') | length > 0 %}
{% if pgbouncer_install|bool and haproxy_listen_port.replicas_direct is defined %}
listen replicas_direct
{% if cluster_vip is defined and cluster_vip | length > 0 %}
bind {{ cluster_vip }}:{{ haproxy_listen_port.replicas_direct }}
Expand Down Expand Up @@ -128,7 +128,7 @@ server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['inventory_hos
{% endfor %}
{% endif %}

{% if pgbouncer_install|bool and haproxy_listen_port.replicas_sync_direct | default('') | length > 0 %}
{% if pgbouncer_install|bool and haproxy_listen_port.replicas_sync_direct is defined %}
listen replicas_sync_direct
{% if cluster_vip is defined and cluster_vip | length > 0 %}
bind {{ cluster_vip }}:{{ haproxy_listen_port.replicas_sync_direct }}
Expand Down Expand Up @@ -169,7 +169,7 @@ server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['inventory_hos
{% endfor %}
{% endif %}

{% if pgbouncer_install|bool and haproxy_listen_port.replicas_async_direct | default('') | length > 0 %}
{% if pgbouncer_install|bool and haproxy_listen_port.replicas_async_direct is defined %}
listen replicas_async_direct
{% if cluster_vip is defined and cluster_vip | length > 0 %}
bind {{ cluster_vip }}:{{ haproxy_listen_port.replicas_async_direct }}
Expand Down
8 changes: 4 additions & 4 deletions roles/upgrade/templates/haproxy-no-http-checks.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ listen master
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['inventory_hostname'] }}:{{ pgbouncer_listen_port }}
{% endfor %}

{% if haproxy_listen_port.master_direct | default('') | length > 0 %}
{% if haproxy_listen_port.master_direct is defined %}
listen master_direct
{% if cluster_vip is defined and cluster_vip | length > 0 %}
bind {{ cluster_vip }}:{{ haproxy_listen_port.master_direct }}
Expand All @@ -64,7 +64,7 @@ listen replicas
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['inventory_hostname'] }}:{{ pgbouncer_listen_port }}
{% endfor %}

{% if haproxy_listen_port.replicas_direct | default('') | length > 0 %}
{% if haproxy_listen_port.replicas_direct is defined %}
listen replicas_direct
{% if cluster_vip is defined and cluster_vip | length > 0 %}
bind {{ cluster_vip }}:{{ haproxy_listen_port.replicas_direct }}
Expand Down Expand Up @@ -92,7 +92,7 @@ listen replicas_sync
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['inventory_hostname'] }}:{{ pgbouncer_listen_port }}
{% endfor %}

{% if haproxy_listen_port.replicas_sync_direct | default('') | length > 0 %}
{% if haproxy_listen_port.replicas_sync_direct is defined %}
listen replicas_sync_direct
{% if cluster_vip is defined and cluster_vip | length > 0 %}
bind {{ cluster_vip }}:{{ haproxy_listen_port.replicas_sync_direct }}
Expand Down Expand Up @@ -120,7 +120,7 @@ listen replicas_async
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['inventory_hostname'] }}:{{ pgbouncer_listen_port }}
{% endfor %}

{% if haproxy_listen_port.replicas_async_direct | default('') | length > 0 %}
{% if haproxy_listen_port.replicas_async_direct is defined %}
listen replicas_async_direct
{% if cluster_vip is defined and cluster_vip | length > 0 %}
bind {{ cluster_vip }}:{{ haproxy_listen_port.replicas_async_direct }}
Expand Down

0 comments on commit 1604ea7

Please sign in to comment.