Class: Chef::Knife::Bootstrap

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/knife/bootstrap_solo.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.load_depsObject



7
8
9
10
11
12
# File 'lib/chef/knife/bootstrap_solo.rb', line 7

def self.load_deps
  super
  require 'chef/knife/solo_bootstrap'
  require 'knife-solo/tools'
  SoloBootstrap.load_deps
end

Instance Method Details

#runObject



21
22
23
24
25
26
27
# File 'lib/chef/knife/bootstrap_solo.rb', line 21

def run
  if KnifeSolo::Tools.config_value(config, :solo)
    run_with_knife_solo
  else
    run_with_chef_client
  end
end

#run_with_chef_clientObject

Rename and override run method



19
# File 'lib/chef/knife/bootstrap_solo.rb', line 19

alias_method :run_with_chef_client, :run

#run_with_knife_soloObject

Bootstraps Chef on the node using knife-solo



30
31
32
33
34
35
36
37
# File 'lib/chef/knife/bootstrap_solo.rb', line 30

def run_with_knife_solo
  validate_name_args!

  bootstrap = SoloBootstrap.new
  bootstrap.name_args = @name_args
  bootstrap.config.merge! config
  bootstrap.run
end