Class: Simp::Cli::Config::Item::LdapSyncHash

Inherits:
Simp::Cli::Config::Item show all
Defined in:
lib/simp/cli/config/item/ldap_sync_hash.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

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

Constructor Details

#initializeLdapSyncHash

Returns a new instance of LdapSyncHash.



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

def initialize
  super
  @key         = 'ldap::sync_hash'
  @skip_query  = true
  @description = %Q{}
end

Instance Method Details

#encrypt(string, salt = nil) ⇒ Object



20
21
22
# File 'lib/simp/cli/config/item/ldap_sync_hash.rb', line 20

def encrypt( string, salt=nil )
  Simp::Cli::Config::Utils.encrypt_openldap_hash( string, salt )
end


16
17
18
# File 'lib/simp/cli/config/item/ldap_sync_hash.rb', line 16

def recommended_value
  encrypt( @config_items.fetch( 'ldap::sync_pw' ).value )
end

#validate(x) ⇒ Object



24
25
26
# File 'lib/simp/cli/config/item/ldap_sync_hash.rb', line 24

def validate( x )
  Simp::Cli::Config::Utils.validate_openldap_hash( x )
end