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.



326
327
328
329
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 326

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

Instance Method Details

#add_backup(backup) ⇒ Object



336
337
338
339
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 336

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

#add_master(master) ⇒ Object



331
332
333
334
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 331

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

#render(lines, direction) ⇒ Object



341
342
343
344
345
346
347
348
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 341

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

#render_backupsObject



354
355
356
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 354

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

#render_mastersObject



350
351
352
# File 'lib/construqt/flavour/ubuntu/flavour_ubuntu_result.rb', line 350

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