Class: Construqt::Flavour::Ubuntu::EtcNetworkVrrp
- Inherits:
-
Object
- Object
- Construqt::Flavour::Ubuntu::EtcNetworkVrrp
- Defined in:
- lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb
Defined Under Namespace
Classes: Vrrp
Instance Method Summary collapse
- #commit(result) ⇒ Object
- #get(ifname) ⇒ Object
-
#initialize ⇒ EtcNetworkVrrp
constructor
A new instance of EtcNetworkVrrp.
Constructor Details
#initialize ⇒ EtcNetworkVrrp
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 |