Skip to content

Commit

Permalink
Merge pull request #305 from frank-f/improve_collect_unicast_peers
Browse files Browse the repository at this point in the history
Improve collect_unicast_peers
  • Loading branch information
bastelfreak authored Jan 19, 2024
2 parents c43ae85 + d954a63 commit 30a21ba
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
14 changes: 7 additions & 7 deletions manifests/vrrp/instance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,6 @@
$auth_pass
}

concat::fragment { "keepalived.conf_vrrp_instance_${_name}":
target => "${keepalived::config_dir}/keepalived.conf",
content => template('keepalived/vrrp_instance.erb'),
order => "100-${_ordersafe}-000",
}

if size($unicast_peer_array) > 0 or $collect_unicast_peers {
concat::fragment { "keepalived.conf_vrrp_instance_${_name}_upeers_header":
target => "${keepalived::config_dir}/keepalived.conf",
Expand All @@ -274,7 +268,7 @@
instance => $name,
ip_address => $unicast_src,
}
Keepalived::Vrrp::Unicast_peer <<| instance == $name and title != $unicast_src |>>
Keepalived::Vrrp::Unicast_peer <<| instance == $name and ip_address != $unicast_src |>>
}

if size($unicast_peer_array) > 0 {
Expand All @@ -293,6 +287,12 @@
}
}

concat::fragment { "keepalived.conf_vrrp_instance_${_name}":
target => "${keepalived::config_dir}/keepalived.conf",
content => template('keepalived/vrrp_instance.erb'),
order => "100-${_ordersafe}-000",
}

concat::fragment { "keepalived.conf_vrrp_instance_${_name}_footer":
target => "${keepalived::config_dir}/keepalived.conf",
content => "}\n\n",
Expand Down
3 changes: 3 additions & 0 deletions templates/vrrp_instance.erb
Original file line number Diff line number Diff line change
Expand Up @@ -224,4 +224,7 @@ vrrp_instance <%= @_name %> {
<%- if @unicast_source_ip -%>

unicast_src_ip <%= @unicast_source_ip %>
<%- elsif @unicast_src -%>

unicast_src_ip <%= @unicast_src %>
<%- end -%>

0 comments on commit 30a21ba

Please sign in to comment.