fix 多lb节点配置文件格式错误 Issue #286

pull/294/head
gjmzj 2018-08-14 19:11:04 +08:00
parent e1e4524a97
commit 0fb1f7ddf3
2 changed files with 6 additions and 4 deletions

View File

@ -7,8 +7,9 @@ vrrp_instance VI-kube-master {
priority 110 priority 110
unicast_src_ip {{ inventory_hostname }} unicast_src_ip {{ inventory_hostname }}
unicast_peer { unicast_peer {
{% for h in groups['lb'] %}{% if h != inventory_hostname %}{{ h }}{% endif %}{% endfor %} {% for h in groups['lb'] %}{% if h != inventory_hostname %}
{{ h }}
{% endif %}{% endfor %}
} }
dont_track_primary dont_track_primary
interface {{ LB_IF }} interface {{ LB_IF }}

View File

@ -13,8 +13,9 @@ vrrp_instance VI-kube-master {
priority 120 priority 120
unicast_src_ip {{ inventory_hostname }} unicast_src_ip {{ inventory_hostname }}
unicast_peer { unicast_peer {
{% for h in groups['lb'] %}{% if h != inventory_hostname %}{{ h }}{% endif %}{% endfor %} {% for h in groups['lb'] %}{% if h != inventory_hostname %}
{{ h }}
{% endif %}{% endfor %}
} }
dont_track_primary dont_track_primary
interface {{ LB_IF }} interface {{ LB_IF }}