629a9a5cd6
The calculation of the keepalived priority depended on the set of hosts in the ansible_play_hosts variable. This meant that priorites changed when the playbook was limited to only run on a subset of the hosts in the "haproxy" group (eg. when reinstalling just one node). This change replaces ansible_play_hosts by groups["haproxy"] so that the priority calculation is stable as long as the set of haproxy nodes does not change. It also simplifies the priority calculation without changeing the result. This change does not change the configuration in case the playbook is run without --limit and ensures that the configuration does not change if it is run with --limit. To make sure the group vars resolution is not done in a all group, which might have 0 haproxy nodes, we ensure the group vars are applied properly to the haproxy group. This is a partial backport of the patch to limit group_vars scoping [1]. [1]: |
||
---|---|---|
.. | ||
haproxy.yml | ||
keepalived.yml |