-
Notifications
You must be signed in to change notification settings - Fork 16
/
ha.cf.erb
28 lines (25 loc) · 924 Bytes
/
ha.cf.erb
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
udpport <%= @heartbeat.udpport %>
autojoin <%= @heartbeat.autojoin %>
<% if @heartbeat.compression -%>
compression <%= @heartbeat.compression %>
<% end -%>
compression_threshold <%= @heartbeat.compression_threshold %>
deadtime <%= @heartbeat.deadtime %>
initdead <%= @heartbeat.initdead %>
keepalive <%= @heartbeat.keepalive %>ms
logfacility <%= @heartbeat.logfacility %>
warntime <%= @heartbeat.warntime %>
<% case @heartbeat.mode.to_sym -%>
<% when :ucast -%>
<% @nodes.select{|n| n['macaddress'] != node['macaddress']}.each do |n| -%>
ucast <%=@interface.first %> <%= n['ipaddress'] %>
<% end -%>
<% when :bcast -%>
bcast <%= @interface.join(' ') %>
<% when :mcast -%>
mcast <%= @interface.first %> <%= @heartbeat.mcast_group %> <%= @heartbeat.udpport %> <%= @heartbeat.mcast_ttl %>
<% end -%>
auto_failback <%= @heartbeat.auto_failback ? "on" : "off" %>
<% @nodes.each do |n| -%>
node <%= n['hostname'] %>
<% end -%>