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 |
# 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) 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 |