Skip to content

Commit 7d739ff

Browse files
committed
Use a stable order for ldirectord config
1 parent 9d16a56 commit 7d739ff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ansible/roles/lvs-ldirectord/templates/ldirectord.cf.j2

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ virtual=1
9090
{% for group, offset in [('scripts-real-f20', 20), ('scripts-real-f30', 30)] %}
9191
{% for service in ['smtp', 'http'] %}
9292
virtual={{ offset + {'smtp': 3, 'http': 2}[service] }}
93-
{% for hostname in groups[group] %}
93+
{% for hostname in groups[group]|sort %}
9494
{% with info = hostvars[hostname] %}
9595
real={{ info['ip'] }} gate {{ 1024 if (info['primary'] | default(False)) else 4096 }} # {{ hostname }}
9696
{% endwith %}
@@ -111,7 +111,7 @@ virtual={{ offset + {'smtp': 3, 'http': 2}[service] }}
111111

112112
# Everything else uses FWM 1 and gets sent only to the primary
113113
virtual={{ offset + 1 }}
114-
{% for hostname in groups[group] %}
114+
{% for hostname in groups[group]|sort %}
115115
{% with info = hostvars[hostname] %}
116116
real={{ info['ip'] }} gate "heartbeat/services?codename={{ info['codename'] }}", "{{ hostname | replace('.mit.edu', '') }}"
117117
{% endwith %}
@@ -125,7 +125,7 @@ virtual={{ offset + 1 }}
125125

126126
# The proxy servers get only web traffic
127127
virtual=92
128-
{% for hostname in groups['scripts-proxy-prod'] %}
128+
{% for hostname in groups['scripts-proxy-prod']|sort %}
129129
{% with info = hostvars[hostname] %}
130130
real={{ info['ip'] }} gate 4096 # {{ hostname }}
131131
{% endwith %}

0 commit comments

Comments
 (0)