class MotherBrain::Bootstrap::Routine::Task

Container for a bootstrap task defined in a bootstrap routine

@api private

Attributes

chef_attributes[R]

@return [Hashie::Mash]

group_name[R]

@return [String]

run_list[R]

@return [Array]

Public Class Methods

from_group(group_path, group) click to toggle source

@param [#to_s] group_path

a string representing the path to a group in a component ("nginx::master")

@param [MB::Group] group

@return [Routine::Task]

# File lib/mb/bootstrap/routine.rb, line 32
def from_group(group_path, group)
  new(group_path, run_list: group.run_list, chef_attributes: group.chef_attributes)
end
from_group_path(plugin, group_path) click to toggle source

Create a new bootstrap routine task from a group path

@param [MB::Plugin] plugin

the plugin to find the group in

@param [#to_s] group_path

a string representing the path to a group in a component ("nginx::master")

@raise [MB::PluginSyntaxError] if the group or component is not found on the plugin

@return [Routine::Task]

# File lib/mb/bootstrap/routine.rb, line 19
def from_group_path(plugin, group_path)
  component_id, group_id = group_path.to_s.split('::')
  group                  = plugin.component!(component_id).group!(group_id)
  from_group(group_path, group)
rescue ComponentNotFound, GroupNotFound => ex
  raise PluginSyntaxError, ex
end
new(group_name, options = {}) click to toggle source

@param [String] group_name

# File lib/mb/bootstrap/routine.rb, line 45
def initialize(group_name, options = {})
  @group_name      = group_name
  @run_list        = options[:run_list] || Array.new
  @chef_attributes = options[:chef_attributes] || Hashie::Mash.new
end