Class: Chef::Knife::Cloud::BootstrapProtocol
- Inherits:
-
Object
- Object
- Chef::Knife::Cloud::BootstrapProtocol
- Includes:
- Helpers
- Defined in:
- lib/chef/knife/cloud/chefbootstrap/bootstrap_protocol.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#bootstrap ⇒ Object
Returns the value of attribute bootstrap.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#initial_sleep_delay ⇒ Object
Returns the value of attribute initial_sleep_delay.
-
#ui ⇒ Object
Returns the value of attribute ui.
Instance Method Summary collapse
- #init_bootstrap_options ⇒ Object
-
#initialize(config) ⇒ BootstrapProtocol
constructor
A new instance of BootstrapProtocol.
- #send_bootstrap_command ⇒ Object
- #wait_for_server_ready ⇒ Object
Methods included from Helpers
#locate_config_value, #msg_pair
Constructor Details
#initialize(config) ⇒ BootstrapProtocol
Returns a new instance of BootstrapProtocol.
32 33 34 35 |
# 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 |
Instance Attribute Details
#bootstrap ⇒ Object
Returns the value of attribute bootstrap.
29 30 31 |
# File 'lib/chef/knife/cloud/chefbootstrap/bootstrap_protocol.rb', line 29 def bootstrap @bootstrap end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
30 31 32 |
# File 'lib/chef/knife/cloud/chefbootstrap/bootstrap_protocol.rb', line 30 def config @config end |
#initial_sleep_delay ⇒ Object
Returns the value of attribute initial_sleep_delay.
29 30 31 |
# File 'lib/chef/knife/cloud/chefbootstrap/bootstrap_protocol.rb', line 29 def initial_sleep_delay @initial_sleep_delay end |
#ui ⇒ Object
Returns the value of attribute ui.
29 30 31 |
# File 'lib/chef/knife/cloud/chefbootstrap/bootstrap_protocol.rb', line 29 def ui @ui end |
Instance Method Details
#init_bootstrap_options ⇒ Object
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 |
# File 'lib/chef/knife/cloud/chefbootstrap/bootstrap_protocol.rb', line 47 def # set the command bootstrap options. bootstrap.name_args = locate_config_value(:bootstrap_ip_address) bootstrap.config[:chef_node_name] = locate_config_value(:chef_node_name) bootstrap.config[:run_list] = locate_config_value(:run_list) bootstrap.config[:prerelease] = locate_config_value(:prerelease) bootstrap.config[:bootstrap_version] = locate_config_value(:bootstrap_version) bootstrap.config[:distro] = locate_config_value(:distro) bootstrap.config[:bootstrap_proxy] = locate_config_value(:bootstrap_proxy) bootstrap.config[:environment] = locate_config_value(:environment) # see chef/knife/bootstrap.rb #warn_chef_config_secret_key. bootstrap.config[:encrypted_data_bag_secret] = locate_config_value(:encrypted_data_bag_secret) bootstrap.config[:encrypted_data_bag_secret_file] = locate_config_value(:encrypted_data_bag_secret_file) bootstrap.config[:first_boot_attributes] = locate_config_value(:first_boot_attributes) bootstrap.config[:secret] = locate_config_value(:secret) bootstrap.config[:secret_file] = locate_config_value(:secret_file) bootstrap.config[:template_file] = locate_config_value(:template_file) bootstrap.config[:bootstrap_template] = locate_config_value(:bootstrap_template) bootstrap.config[:node_ssl_verify_mode] = locate_config_value(:node_ssl_verify_mode) bootstrap.config[:node_verify_api_cert] = locate_config_value(:node_verify_api_cert) bootstrap.config[:bootstrap_no_proxy] = locate_config_value(:bootstrap_no_proxy) bootstrap.config[:bootstrap_url] = locate_config_value(:bootstrap_url) bootstrap.config[:bootstrap_install_command] = locate_config_value(:bootstrap_install_command) bootstrap.config[:bootstrap_wget_options] = locate_config_value(:bootstrap_wget_options) bootstrap.config[:bootstrap_curl_options] = locate_config_value(:bootstrap_curl_options) bootstrap.config[:bootstrap_vault_file] = locate_config_value(:bootstrap_vault_file) bootstrap.config[:bootstrap_vault_json] = locate_config_value(:bootstrap_vault_json) bootstrap.config[:bootstrap_vault_item] = locate_config_value(:bootstrap_vault_item) bootstrap.config[:use_sudo_password] = locate_config_value(:use_sudo_password) end |
#send_bootstrap_command ⇒ Object
41 42 43 44 45 |
# File 'lib/chef/knife/cloud/chefbootstrap/bootstrap_protocol.rb', line 41 def send_bootstrap_command wait_for_server_ready @bootstrap.run end |
#wait_for_server_ready ⇒ Object
37 38 39 |
# 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.to_s}" end |