Sha256: 21d1aaa80edf16facf8a2776917224893ad2d8d3a59cd9288fbe227bc1b6c5b3

Contents?: true

Size: 886 Bytes

Versions: 15

Compression:

Stored size: 886 Bytes

Contents

require 'chef/knife/bootstrap'

class Chef
  class Knife
    class Bootstrap

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

      option :solo,
        :long        => '--[no-]solo',
        :description => 'Bootstrap using knife-solo'

      # Rename and override run method
      alias_method :run_with_chef_client, :run

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

      # Bootstraps Chef on the node using knife-solo
      def run_with_knife_solo
        validate_name_args!

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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
knife-solo-0.7.0 lib/chef/knife/bootstrap_solo.rb
knife-solo-0.7.0.pre3 lib/chef/knife/bootstrap_solo.rb
knife-solo-0.7.0.pre2 lib/chef/knife/bootstrap_solo.rb
knife-solo-0.7.0.pre lib/chef/knife/bootstrap_solo.rb
knife-solo-0.6.0 lib/chef/knife/bootstrap_solo.rb
knife-solo-0.4.3 lib/chef/knife/bootstrap_solo.rb
knife-solo-0.5.1 lib/chef/knife/bootstrap_solo.rb
knife-solo-0.5.0 lib/chef/knife/bootstrap_solo.rb
knife-solo-0.4.2 lib/chef/knife/bootstrap_solo.rb
knife-solo-0.4.1 lib/chef/knife/bootstrap_solo.rb
knife-solo-0.4.0 lib/chef/knife/bootstrap_solo.rb
knife-solo-0.3.0 lib/chef/knife/bootstrap_solo.rb
knife-solo-0.3.0.pre5 lib/chef/knife/bootstrap_solo.rb
knife-solo-0.3.0.pre4 lib/chef/knife/bootstrap_solo.rb
knife-solo-0.3.0.pre3 lib/chef/knife/bootstrap_solo.rb