class Construqt::Flavour::Ubuntu::EtcNetworkVrrp

Public Class Methods

new() click to toggle source
# File lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb, line 399
def initialize
  @interfaces = {}
end

Public Instance Methods

commit(result) click to toggle source
# File lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb, line 441
        def commit(result)
          @interfaces.keys.sort.each do |ifname|
            vrrp = @interfaces[ifname]
            result.add(self, <<VRRP, Construqt::Resources::Rights.root_0755(Construqt::Resources::Component::VRRP), "etc", "network", "vrrp.#{ifname}.stop.sh")
#!/bin/bash
#{vrrp.render_backups}
exit 0
VRRP
            result.add(self, <<VRRP, Construqt::Resources::Rights.root_0755(Construqt::Resources::Component::VRRP), "etc", "network", "vrrp.#{ifname}.sh")
#!/bin/bash

TYPE=$1
NAME=$2
STATE=$3

case $STATE in
        "MASTER")
#{vrrp.render_masters}
                  exit 0
                  ;;
        "BACKUP")
#{vrrp.render_backups}
                  exit 0
                  ;;
        *)        echo "unknown state"
                  exit 1
                  ;;
esac
VRRP
          end
        end
get(ifname) click to toggle source
# File lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb, line 437
def get(ifname)
  @interfaces[ifname] ||= Vrrp.new
end