class HttpdConfigmapGenerator::Principal

Attributes

hostname[RW]
name[RW]
realm[RW]
service[RW]

Public Class Methods

new(options = {}) click to toggle source
# 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

Public Instance Methods

register() click to toggle source
# File lib/httpd_configmap_generator/base/principal.rb, line 18
def register
  request unless exist?
end

Private Instance Methods

exist?() click to toggle source
# File lib/httpd_configmap_generator/base/principal.rb, line 24
def exist?
  command_run(IPA_COMMAND, :params => ["-e", "skip_version_check=1", "service-find", "--principal", name]).success?
end
request() click to toggle source
# File lib/httpd_configmap_generator/base/principal.rb, line 28
def request
  # Using --force because these services tend not to be in dns. This is like VERIFY_NONE.
  command_run!(IPA_COMMAND, :params => ["-e", "skip_version_check=1", "service-add", "--force", name])
end