Module: Chef::Knife::ServerBootstrapBase

Overview

Common behavior for server bootstrapping.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(included_class) ⇒ Object

rubocop:disable Metrics/MethodLength



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/chef/knife/server_bootstrap_base.rb', line 27

def self.included(included_class) # rubocop:disable Metrics/MethodLength
  included_class.class_eval do

    deps do
      require "chef/knife/ssh"
      require "net/ssh"
    end

    option :platform,
      :short => "-P PLATFORM",
      :long => "--platform PLATFORM",
      :description => "The platform type that will be bootstrapped, "\
        "default is 'omnibus'",
      :default => "omnibus"

    option :distro,
      :short => "-d DISTRO",
      :long => "--distro DISTRO",
      :description => "Bootstrap a distro using a template, " \
        "default is 'chef11/omnibus'"

    option :bootstrap_version,
      :long => "--bootstrap-version VERSION",
      :description => "The version of Chef Server to install, " \
        "default is latest release",
      :proc => proc { |v| Chef::Config[:knife][:bootstrap_version] = v },
      :default => nil

    option :prerelease,
      :long => "--prerelease",
      :description => "Install a pre-release version of Chef Server"

    option :webui_enable,
      :long => "--[no-]webui-enable",
      :description => "Whether or not to enable the webui, " \
        "default is false",
      :proc => proc { |v| Chef::Config[:knife][:webui_enable] = v },
      :default => false

    option :webui_password,
      :long => "--webui-password SECRET",
      :description => "Initial password for WebUI admin account, " \
        "default is 'chefchef'",
      :default => "chefchef"

    option :amqp_password,
      :long => "--amqp-password SECRET",
      :description => "Initial password for AMQP, default is 'chefchef'",
      :default => "chefchef"

    option :log_level,
      :short => "-l LEVEL",
      :long => "--log-level LEVEL",
      :description  => "Set the log level " \
        "(debug, info, warn, error, fatal), default is error",
      :proc => proc { |v| Chef::Config[:knife][:log_level] = v.to_sym },
      :default => :error

    option :no_test,
      :short => "-n",
      :long => "--no-test",
      :description => "Do not run opscode pedant as a part of the " \
        "omnibus installation"

    option :url,
      :long => "--url URL",
      :description => "URL to specfic package release",
      :proc => proc { |u| Chef::Config[:knife][:server_package_url] = u }
  end
end

Instance Method Details

#runObject



98
99
100
# File 'lib/chef/knife/server_bootstrap_base.rb', line 98

def run
  validate!
end