Class: HttpdConfigmapGenerator::Sssd
- Inherits:
-
Base
- Object
- Base
- HttpdConfigmapGenerator::Sssd
show all
- Defined in:
- lib/httpd_configmap_generator/base/sssd.rb
Constant Summary
Constants inherited
from Base
Base::APACHE_USER, Base::HOSTNAME_COMMAND, Base::HTTP_KEYTAB, Base::IPA_COMMAND, Base::KERBEROS_CONFIG_FILE, Base::LDAP_ATTRS, Base::PAM_CONFIG, Base::SSSD_CONFIG, Base::TIMESTAMP_FORMAT
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Base
#command_run, #command_run!, #config_file_backup, #configure_pam, #cp_template, #create_target_directory, #debug_msg, #delete_target_file, #domain, #domain_from_host, #enable_kerberos_dns_lookups, #err_msg, #fetch_network_file, #file_binary?, #host_reachable?, #info_msg, #log_command_error, #optional_options, #path_join, #realm, #required_options, #rm_file, #run_configure, #template_directory, #update_hostname, #validate_options
Constructor Details
#initialize(opts = {}) ⇒ Sssd
Returns a new instance of Sssd.
8
9
10
11
|
# File 'lib/httpd_configmap_generator/base/sssd.rb', line 8
def initialize(opts = {})
@opts = opts
@sssd = nil
end
|
Instance Attribute Details
#opts ⇒ Object
Returns the value of attribute opts.
6
7
8
|
# File 'lib/httpd_configmap_generator/base/sssd.rb', line 6
def opts
@opts
end
|
#sssd ⇒ Object
Returns the value of attribute sssd.
5
6
7
|
# File 'lib/httpd_configmap_generator/base/sssd.rb', line 5
def sssd
@sssd
end
|
Instance Method Details
#add_service(service) ⇒ Object
30
31
32
33
34
35
|
# File 'lib/httpd_configmap_generator/base/sssd.rb', line 30
def add_service(service)
services = section("sssd")["services"]
services = (services.split(",").map(&:strip) | [service]).join(", ")
sssd.section("sssd")["services"] = services
sssd.section(service)
end
|
#configure_domain(domain) ⇒ Object
24
25
26
27
28
|
# File 'lib/httpd_configmap_generator/base/sssd.rb', line 24
def configure_domain(domain)
domain = section("domain/#{domain}")
domain["ldap_user_extra_attrs"] = LDAP_ATTRS.keys.join(", ")
domain["entry_cache_timeout"] = 600
end
|
37
38
39
40
41
42
|
# File 'lib/httpd_configmap_generator/base/sssd.rb', line 37
def configure_ifp
add_service("ifp")
ifp = section("ifp")
ifp["allowed_uids"] = "#{APACHE_USER}, root"
ifp["user_attributes"] = LDAP_ATTRS.keys.collect { |k| "+#{k}" }.join(", ")
end
|
#load(file_path) ⇒ Object
13
14
15
|
# File 'lib/httpd_configmap_generator/base/sssd.rb', line 13
def load(file_path)
@sssd = IniParse.open(file_path)
end
|
#save(file_path) ⇒ Object
17
18
19
20
21
22
|
# File 'lib/httpd_configmap_generator/base/sssd.rb', line 17
def save(file_path)
return unless sssd
config_file_backup(file_path)
info_msg("Saving SSSD to #{file_path}")
sssd.save(file_path)
end
|
#section(key) ⇒ Object
44
45
46
47
48
49
|
# File 'lib/httpd_configmap_generator/base/sssd.rb', line 44
def section(key)
if key =~ /^domain\/.*$/
key = sssd.entries.collect(&:key).select { |k| k.downcase == key.downcase }.first
end
sssd.section(key)
end
|