class Chef::Knife::Cloud::BootstrapProtocol

Attributes

bootstrap[RW]
config[R]
initial_sleep_delay[RW]
ui[RW]

Public Class Methods

new(config) click to toggle source
# File lib/chef/knife/cloud/chefbootstrap/bootstrap_protocol.rb, line 32
def initialize(config)
  @config = config
  @ui ||= Chef::Knife::UI.new(STDOUT, STDERR, STDIN, {})
end

Public Instance Methods

init_bootstrap_options() click to toggle source
# File lib/chef/knife/cloud/chefbootstrap/bootstrap_protocol.rb, line 47
def init_bootstrap_options
  # set the command bootstrap options.
  bootstrap.name_args << config[:bootstrap_ip_address]
  bootstrap.config[:chef_node_name] = config[:chef_node_name]
  bootstrap.config[:run_list] = config[:run_list]
  bootstrap.config[:prerelease] = config[:prerelease]
  bootstrap.config[:bootstrap_version] = config[:bootstrap_version]
  bootstrap.config[:bootstrap_proxy] = config[:bootstrap_proxy]
  bootstrap.config[:environment] = config[:environment]
  # see chef/knife/bootstrap.rb #warn_chef_config_secret_key.
  bootstrap.config[:encrypted_data_bag_secret] = config[:encrypted_data_bag_secret]
  bootstrap.config[:encrypted_data_bag_secret_file] = config[:encrypted_data_bag_secret_file]
  bootstrap.config[:first_boot_attributes] = config[:first_boot_attributes]
  bootstrap.config[:secret] = config[:secret]
  bootstrap.config[:secret_file] = config[:secret_file]
  bootstrap.config[:bootstrap_template] = config[:bootstrap_template]
  bootstrap.config[:node_ssl_verify_mode] = config[:node_ssl_verify_mode]
  bootstrap.config[:node_verify_api_cert] = config[:node_verify_api_cert]
  bootstrap.config[:bootstrap_no_proxy] = config[:bootstrap_no_proxy]
  bootstrap.config[:bootstrap_url] = config[:bootstrap_url]
  bootstrap.config[:bootstrap_install_command] = config[:bootstrap_install_command]
  bootstrap.config[:bootstrap_wget_options] = config[:bootstrap_wget_options]
  bootstrap.config[:bootstrap_curl_options] = config[:bootstrap_curl_options]
  bootstrap.config[:bootstrap_vault_file] = config[:bootstrap_vault_file]
  bootstrap.config[:bootstrap_vault_json] = config[:bootstrap_vault_json]
  bootstrap.config[:bootstrap_vault_item] = config[:bootstrap_vault_item]
  bootstrap.config[:use_sudo_password] = config[:use_sudo_password]
  bootstrap.config[:msi_url] = config[:msi_url]
  bootstrap.config[:install_as_service] = config[:install_as_service]
  bootstrap.config[:session_timeout] = config[:session_timeout]
  bootstrap.config[:channel] = config[:channel]
  bootstrap.config[:bootstrap_product] = config[:bootstrap_product]
end
send_bootstrap_command() click to toggle source
# File lib/chef/knife/cloud/chefbootstrap/bootstrap_protocol.rb, line 41
def send_bootstrap_command
  wait_for_server_ready
  init_bootstrap_options
  @bootstrap.run
end
wait_for_server_ready() click to toggle source
# File lib/chef/knife/cloud/chefbootstrap/bootstrap_protocol.rb, line 37
def wait_for_server_ready
  raise Chef::Exceptions::Override, "You must override wait_for_server_ready in #{self}"
end