Class: Rivet::Bootstrap

Inherits:
Object
  • Object
show all
Defined in:
lib/rivet/bootstrap.rb

Constant Summary collapse

TEMPLATE_SUB_DIR =
"bootstrap"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bootstrap_definition = Hash.new) ⇒ Bootstrap

Returns a new instance of Bootstrap.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rivet/bootstrap.rb', line 8

def initialize(bootstrap_definition = Hash.new)
  ivars = [
    'gems','run_list','template','environment',
    'config_dir','chef_organization']

  ivars.each do |i|
    if bootstrap_definition.has_key?(i)
      instance_variable_set("@#{i}",bootstrap_definition[i])
    end
  end unless bootstrap_definition.nil?

  @config_dir ||= "."
  @template   ||= "default.erb"

  set_calculated_attrs
end

Instance Attribute Details

#chef_commandObject (readonly)

Returns the value of attribute chef_command.



6
7
8
# File 'lib/rivet/bootstrap.rb', line 6

def chef_command
  @chef_command
end

#chef_organizationObject (readonly)

Returns the value of attribute chef_organization.



6
7
8
# File 'lib/rivet/bootstrap.rb', line 6

def chef_organization
  @chef_organization
end

#environmentObject (readonly)

Returns the value of attribute environment.



5
6
7
# File 'lib/rivet/bootstrap.rb', line 5

def environment
  @environment
end

#gemsObject (readonly)

Returns the value of attribute gems.



5
6
7
# File 'lib/rivet/bootstrap.rb', line 5

def gems
  @gems
end

#run_listObject (readonly)

Returns the value of attribute run_list.



5
6
7
# File 'lib/rivet/bootstrap.rb', line 5

def run_list
  @run_list
end

#templateObject (readonly)

Returns the value of attribute template.



5
6
7
# File 'lib/rivet/bootstrap.rb', line 5

def template
  @template
end

#template_pathObject (readonly)

Returns the value of attribute template_path.



6
7
8
# File 'lib/rivet/bootstrap.rb', line 6

def template_path
  @template_path
end

Instance Method Details

#user_dataObject



25
26
27
# File 'lib/rivet/bootstrap.rb', line 25

def user_data
  @user_data ||= generate_user_data
end