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

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

Instance Method Summary collapse

Constructor Details

#initializeVrrp

Returns a new instance of Vrrp.



392
393
394
395
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 392

def initialize
  @masters = []
  @backups = []
end

Instance Method Details

#add_backup(backup) ⇒ Object



402
403
404
405
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 402

def add_backup(backup)
  @backups << backup
  self
end

#add_master(master) ⇒ Object



397
398
399
400
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 397

def add_master(master)
  @masters << master
  self
end

#render(lines, direction) ⇒ Object



407
408
409
410
411
412
413
414
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 407

def render(lines, direction)
  lines.map do |line|
    [
      "                  logger '#{direction}#{line}'",
      "                  #{line}"
    ]
  end.join("\n")
end

#render_backupsObject



420
421
422
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 420

def render_backups
  render(@backups, 'STOPPING:')
end

#render_mastersObject



416
417
418
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 416

def render_masters
  render(@masters, 'STARTING:')
end