Class: Construqt::Flavour::Ubuntu::EtcNetworkVrrp

Inherits:
Object
  • Object
show all
Defined in:
lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb

Defined Under Namespace

Classes: Vrrp

Instance Method Summary collapse

Constructor Details

#initializeEtcNetworkVrrp

Returns a new instance of EtcNetworkVrrp.



387
388
389
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 387

def initialize
  @interfaces = {}
end

Instance Method Details

#commit(result) ⇒ Object



429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 429

def commit(result)
  @interfaces.keys.sort.each do |ifname|
    vrrp = @interfaces[ifname]
    result.add(self, <<VRRP, Construqt::Resources::Rights::ROOT_0755, "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) ⇒ Object



425
426
427
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 425

def get(ifname)
  @interfaces[ifname] ||= Vrrp.new
end