maxscale: refs #8822 - refactor some minnor things

This commit is contained in:
Xavi Lleó 2025-04-11 13:42:01 +02:00
parent e1c7759e7a
commit cf83aa4592
1 changed files with 5 additions and 6 deletions

View File

@ -16,23 +16,22 @@ vrrp_script check_maxscale {
vrrp_instance {{ vip.name }} {
interface {{ k.interface }}
state BACKUP
priority {{ k.priorities.master if vip.host == inventory_hostname_short else k.priorities.backup }}
priority {{ k.priorities.master if vip.host == inventory_hostname else k.priorities.backup }}
virtual_router_id {{ vip.vrid }}
advert_int 1
accept
unicast_src_ip {{ ansible_host }}
unicast_src_ip {{ ansible_default_ipv4.address }}
unicast_peer {
{% for peer in k.peers if peer.host != inventory_hostname %}
{% for peer in k.peers %}
{% if peer.host != inventory_hostname %}
{{ peer.ip }}
{% endif %}
{% endfor %}
}
virtual_ipaddress {
{{ vip.vip }}
}
track_script {
check_maxscale
}