Browse Source

Allow backend and backup node rise/fall parameters to be set

The template previously set the rise/fall count to the number
of backend/backup nodes. This may not always be appropriate
so this patch allows the rise/fall counts to be defined per
service if required. The default behaviour remains unchanged
if no rise/fall counts are provided.

Change-Id: Ib413b622310b1f6f5146060089af7dffc0dd9236
changes/24/625124/1
Jonathan Rosser 6 months ago
parent
commit
e5104a345c
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      templates/service.j2

+ 4
- 4
templates/service.j2 View File

@@ -112,9 +112,9 @@ backend {{ item.service.haproxy_service_name }}-back
112 112
 {% set _ = entry.append("inter") %}
113 113
 {% set _ = entry.append(haproxy_interval | string) %}
114 114
 {% set _ = entry.append("rise") %}
115
-{% set _ = entry.append(item.service.haproxy_backend_nodes | count | string) %}
115
+{% set _ = entry.append(item.service.backend_rise|default(item.service.haproxy_backend_nodes | count | string)) %}
116 116
 {% set _ = entry.append("fall") %}
117
-{% set _ = entry.append(item.service.haproxy_backend_nodes | count | string) %}
117
+{% set _ = entry.append(item.service.backend_fall|default(item.service.haproxy_backend_nodes | count | string)) %}
118 118
 {% if item.service.haproxy_backend_ssl | default(False) %}
119 119
 {% set _ = entry.append("ssl") %}
120 120
 {% if item.service.haproxy_backend_ca %}
@@ -145,9 +145,9 @@ backend {{ item.service.haproxy_service_name }}-back
145 145
 {% set _ = entry.append("inter") %}
146 146
 {% set _ = entry.append(haproxy_interval | string) %}
147 147
 {% set _ = entry.append("rise") %}
148
-{% set _ = entry.append(item.service.haproxy_backup_nodes | count | string) %}
148
+{% set _ = entry.append(item.service.backup_rise|default(item.service.haproxy_backup_nodes | count | string)) %}
149 149
 {% set _ = entry.append("fall") %}
150
-{% set _ = entry.append(item.service.haproxy_backup_nodes | count | string) %}
150
+{% set _ = entry.append(item.service.backup_fall|default(item.service.haproxy_backup_nodes | count | string)) %}
151 151
 {% set _ = entry.append("backup") %}
152 152
 {% if item.service.haproxy_backend_ssl | default(False) %}
153 153
 {% set _ = entry.append("ssl") %}

Loading…
Cancel
Save