Class: Simp::Cli::Config::Item::LdapBindDn
Instance Attribute Summary
#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
#apply, #default_value, #highline_question_type, #next_items, #not_valid_message, #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
9
10
11
12
13
|
# File 'lib/simp/cli/config/item/ldap_bind_dn.rb', line 9
def initialize
super
@key = 'ldap::bind_dn'
@description = %Q{LDAP Bind Distinguished Name}
end
|
Instance Method Details
#os_value ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/simp/cli/config/item/ldap_bind_dn.rb', line 16
def os_value
if File.readable?('/etc/openldap/ldap.conf') &&
`grep BINDDN /etc/openldap/ldap.conf` =~ /\ABINDDN\s+(\S+)\s*/
$1
end
end
|
#recommended_value ⇒ Object
30
31
32
|
# File 'lib/simp/cli/config/item/ldap_bind_dn.rb', line 30
def recommended_value
"cn=hostAuth,ou=Hosts,%{hiera('ldap::base_dn')}"
end
|
#validate(x) ⇒ Object
25
26
27
|
# File 'lib/simp/cli/config/item/ldap_bind_dn.rb', line 25
def validate( x )
(x.to_s =~ /^cn=/) ? true : false
end
|