Class: Simp::Cli::Config::Item::SetupNIC
- Inherits:
-
YesNoItem
- Object
- Simp::Cli::Config::Item
- YesNoItem
- Simp::Cli::Config::Item::SetupNIC
- Defined in:
- lib/simp/cli/config/item/network_setup_nic.rb
Instance Attribute Summary
Attributes inherited from Simp::Cli::Config::Item
#allow_user_apply, #config_items, #description, #die_on_apply_fail, #fact, #fail_on_missing_answer, #key, #next_items_tree, #silent, #skip_apply, #skip_query, #skip_yaml, #value
Instance Method Summary collapse
-
#initialize ⇒ SetupNIC
constructor
A new instance of SetupNIC.
- #query_ask ⇒ Object
- #recommended_value ⇒ Object
Methods inherited from YesNoItem
#highline_question_type, #next_items, #not_valid_message, #to_yaml_s, #validate
Methods inherited from Simp::Cli::Config::Item
#apply, #default_value, #highline_question_type, #next_items, #not_valid_message, #os_value, #print_banner, #print_summary, #puppet_value, #query, #query_extras, #query_status, #safe_apply, #say_blue, #say_green, #say_red, #say_yellow, #to_yaml_s, #validate
Constructor Details
#initialize ⇒ SetupNIC
Returns a new instance of SetupNIC.
9 10 11 12 13 |
# File 'lib/simp/cli/config/item/network_setup_nic.rb', line 9 def initialize super @key = 'network::setup_nic' @description = %Q{Do you want to activate this NIC now?} end |
Instance Method Details
#query_ask ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/simp/cli/config/item/network_setup_nic.rb', line 19 def query_ask # TODO: check, then # The NIC does not currently have an IP, Netmask, or Gateway nic = @config_items.fetch('network::interface').value # @description.gsub( 'this NIC' super end |
#recommended_value ⇒ Object
15 16 17 |
# File 'lib/simp/cli/config/item/network_setup_nic.rb', line 15 def recommended_value os_value || 'yes' end |