Class: HttpdConfigmapGenerator::Principal

Inherits:
Base
  • Object
show all
Defined in:
lib/httpd_configmap_generator/base/principal.rb

Constant Summary

Constants inherited from Base

Base::APACHE_USER, Base::HTTP_KEYTAB, Base::IPA_COMMAND, Base::KERBEROS_CONFIG_FILE, Base::LDAP_ATTRS, Base::PAM_CONFIG, Base::SSSD_CONFIG, Base::TIMESTAMP_FORMAT

Constants included from Base::Network

Base::Network::HOSTNAME_COMMAND

Instance Attribute Summary collapse

Attributes inherited from Base

#opts

Instance Method Summary collapse

Methods inherited from Base

#debug_msg, #err_msg, #info_msg, #optional_options, #required_options, #run_configure, #validate_options

Methods included from Base::Pam

#configure_pam

Methods included from Base::Network

#domain, #domain_from_host, #fetch_network_file, #host_reachable?, #update_hostname

Methods included from Base::Kerberos

#enable_kerberos_dns_lookups

Methods included from Base::FileHelper

#cp_template, #create_target_directory, #delete_target_file, #file_binary?, #path_join, #rm_file, #template_directory

Methods included from Base::ConfigHelper

#config_file_backup

Methods included from Base::Command

#command_run, #command_run!, #log_command_error

Constructor Details

#initialize(options = {}) ⇒ Principal

Returns a new instance of Principal.



11
12
13
14
15
16
# File 'lib/httpd_configmap_generator/base/principal.rb', line 11

def initialize(options = {})
  options.each { |n, v| public_send("#{n}=", v) }
  @realm = @realm.upcase if @realm
  @name ||= "#{service}/#{hostname}@#{realm}"
  @name
end

Instance Attribute Details

#hostnameObject

Returns the value of attribute hostname.



5
6
7
# File 'lib/httpd_configmap_generator/base/principal.rb', line 5

def hostname
  @hostname
end

#nameObject

Kerberos principal name generated



9
10
11
# File 'lib/httpd_configmap_generator/base/principal.rb', line 9

def name
  @name
end

#realmObject

EXAMPLE.COM



6
7
8
# File 'lib/httpd_configmap_generator/base/principal.rb', line 6

def realm
  @realm
end

#serviceObject

HTTP



7
8
9
# File 'lib/httpd_configmap_generator/base/principal.rb', line 7

def service
  @service
end

Instance Method Details

#registerObject



18
19
20
# File 'lib/httpd_configmap_generator/base/principal.rb', line 18

def register
  request unless exist?
end