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.



404
405
406
407
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 404

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

Instance Method Details

#add_backup(backup) ⇒ Object



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

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

#add_master(master) ⇒ Object



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

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

#render(lines, direction) ⇒ Object



419
420
421
422
423
424
425
426
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 419

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

#render_backupsObject



432
433
434
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 432

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

#render_mastersObject



428
429
430
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 428

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