Class: MotherBrain::Bootstrap::Routine::CleanRoom Private

Inherits:
CleanRoomBase
  • Object
show all
Defined in:
lib/mb/bootstrap/routine.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Methods inherited from CleanRoomBase

dsl_attr_writer, #initialize

Methods included from Logging

add_argument_header, dev, filename, #log_exception, logger, #logger, reset, set_logger, setup

Constructor Details

This class inherits a constructor from MotherBrain::CleanRoomBase

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MotherBrain::CleanRoomBase

Instance Method Details

#async(&block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Add an array of Bootstrap::Routine::Task(s) to be executed asyncronously to the MotherBrain::Bootstrap::Routine

Examples:

Routine.new(...) do
  async do
    bootstrap("mysql::master")
    bootstrap("myapp::webserver")
  end
end


183
184
185
186
187
188
# File 'lib/mb/bootstrap/routine.rb', line 183

def async(&block)
  room = self.class.new(real_model)
  room.instance_eval(&block)

  self.task_procs.push room.task_procs
end

#bootstrap(group_path) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Add a Bootstrap::Routine::Task for bootstrapping nodes in the given node group to the MotherBrain::Bootstrap::Routine

Examples:

Routine.new(...) do
  bootstrap("mysql::master")
end

Parameters:

  • group_path (String)

    a group path



170
171
172
# File 'lib/mb/bootstrap/routine.rb', line 170

def bootstrap(group_path)
  self.task_procs.push -> { Task.from_group_path(real_model.plugin, group_path) }
end