Class: Knife::Clc::Bootstrap::ConfigOptions
- Inherits:
-
Object
- Object
- Knife::Clc::Bootstrap::ConfigOptions
- Defined in:
- lib/knife-clc/bootstrap/config_options.rb
Class Method Summary collapse
- .attach(command_class) ⇒ Object
-
.attach_platform_specific_options(command_class) ⇒ Object
TODO AS: Once bootstrapper has separate platform modules - rework this.
Class Method Details
.attach(command_class) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/knife-clc/bootstrap/config_options.rb', line 8 def self.attach(command_class) command_class.class_eval do option :clc_bootstrap, :long => '--bootstrap', :description => '[Bootstrap] Bootstrap launched server', :boolean => true, :default => false, :on => :head option :clc_bootstrap_private, :long => '--bootstrap-private', :description => '[Bootstrap] Bootstrap from private network. Requires client or SSH gateway to have an access to private network of the server', :boolean => true, :default => false, :on => :head option :clc_bootstrap_platform, :long => '--bootstrap-platform PLATFORM', :description => '[Bootstrap] Sets bootstrapping server platform as windows or linux. Derived automatically by default', :on => :head end (command_class) end |
.attach_platform_specific_options(command_class) ⇒ Object
TODO AS: Once bootstrapper has separate platform modules - rework this
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 |
# File 'lib/knife-clc/bootstrap/config_options.rb', line 34 def self.(command_class) = Chef::Knife::Bootstrap..dup = Chef::Knife::BootstrapWindowsWinrm..dup windows_specific_option_keys = .keys - .keys linux_specific_option_keys = .keys - .keys linux_specific_option_keys.each do |linux_key| description = [linux_key][:description] [linux_key][:description] = '(Linux Only) ' + description end windows_specific_option_keys.each do |windows_key| description = [windows_key][:description] [windows_key][:description] = '(Windows Only) ' + description end .each do |name, settings| settings[:description] = '[Bootstrap] ' + settings[:description] end .each do |name, settings| settings[:description] = '[Bootstrap] ' + settings[:description] end command_class. .merge!() .merge!() end |