summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/cephadm/templates/services/ingress/keepalived.conf.j2
blob: e19f556c6f42727247600466ffdd7097df9b80a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# {{ cephadm_managed }}
vrrp_script check_backend {
    script "{{ script }}"
    weight -20
    interval 2
    rise 2
    fall 2
}

{% for x in range(virtual_ips|length) %}
vrrp_instance VI_{{ x }} {
  state {{ states[x] }}
  priority {{ priorities[x] }}
  interface {{ vrrp_interfaces[x] }}
  virtual_router_id {{ first_virtual_router_id + x }}
  advert_int 1
  authentication {
      auth_type PASS
      auth_pass {{ password }}
  }
{% if not spec.use_keepalived_multicast %}
  unicast_src_ip {{ host_ips[x] }}
  unicast_peer {
    {% for ip in other_ips[x] %}
    {{ ip }}
    {% endfor %}
  }
{% endif %}
  virtual_ipaddress {
    {{ virtual_ips[x] }} dev {{ interfaces[x] }}
  }
  track_script {
      check_backend
  }
}
{% endfor %}