Class: Simp::Cli::Config::Item::SimpYumServers

Inherits:
ListItem show all
Defined in:
lib/simp/cli/config/item/simp_yum_servers.rb

Instance Attribute Summary

Attributes inherited from ListItem

#allow_empty_list

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

Methods inherited from ListItem

#highline_question_type, #not_valid_message, #query_extras, #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_ask, #query_extras, #query_status, #safe_apply, #say_blue, #say_green, #say_red, #say_yellow, #to_yaml_s, #validate

Constructor Details

#initializeSimpYumServers

Returns a new instance of SimpYumServers.



10
11
12
13
14
15
# File 'lib/simp/cli/config/item/simp_yum_servers.rb', line 10

def initialize
  super
  @key         = 'simp::yum::servers'
  @description = %Q{Your SIMP yum server(s).}
  @allow_empty_list = true
end

Instance Method Details



17
18
19
# File 'lib/simp/cli/config/item/simp_yum_servers.rb', line 17

def recommended_value
  ["%{hiera('puppet::server')}"]
end

#validate_item(item) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/simp/cli/config/item/simp_yum_servers.rb', line 21

def validate_item item
  (
    Simp::Cli::Config::Utils.validate_hiera_lookup( item ) ||
    Simp::Cli::Config::Utils.validate_hostname( item ) ||
    Simp::Cli::Config::Utils.validate_fqdn( item ) ||
    Simp::Cli::Config::Utils.validate_ip( item )
  )
end