Sha256: d8aec08d9f499ec6adc656b3640cf4e77fcc95e2ad1dd6980a12fd9e550fa4bf

Contents?: true

Size: 1.4 KB

Versions: 34

Compression:

Stored size: 1.4 KB

Contents

# touch /etc/keepalived/MASTER to make a BACKUP keepalived be MASTER. Remove it to make it BACKUP again.
vrrp_script chk_wanted_state {
        script "test -e /etc/keepalived/MASTER"
        interval <%= keepalived_chk_wanted_state_interval || keepalived_default_script_interval %>
        weight <%= keepalived_chk_wanted_state_weight || keepalived_default_script_weight %>
}

<% keepalived_scripts.each do |name, settings| %>
vrrp_script chk_<%= name.to_s %> {
        script "<%= settings[:script] %>"
        interval <%= settings[:interval] || keepalived_default_script_interval %>
        weight <%= settings[:weight] || keepalived_default_script_weight %>
}
<% end %>

<% instance_counter = 1 %>
<% keepalived_instances.each do |virtual_ipaddress, settings| %>
vrrp_instance VI_<%= instance_counter %> {
        interface <%= settings[:interface] %>
        state <%= settings[:state] %>
        virtual_router_id <%= settings[:virtual_router_id] %>
        priority <%= settings[:priority] %>
        virtual_ipaddress {
            <%= virtual_ipaddress %>
        }
<% if settings[:state] != 'MASTER' %>
	    track_script {
	        chk_wanted_state
	    }
<% end %>
<% (settings[:scripts].nil? || [settings[:scripts]].flatten.empty? ? keepalived_scripts.keys : [settings[:scripts]].flatten).each do |name| %>
        track_script {
            chk_<%= name.to_s %>
        }
<% end %>
}
<% instance_counter += 1 %>
<% end %>

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
le1t0-deprec-2.1.6.088 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.087 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.086 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.085 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.084 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.083 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.082 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.081 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.080 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.079 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.078 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.077 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.076 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.075 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.074 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.073 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.072 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.071 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.070 lib/deprec/templates/keepalived/keepalived.conf.erb
le1t0-deprec-2.1.6.069 lib/deprec/templates/keepalived/keepalived.conf.erb