Sha256: eb5208a767126ae0ba73514750ddfcf6b7bcae0c53c71d07311cf822e090c9b6
Contents?: true
Size: 1.05 KB
Versions: 48
Compression:
Stored size: 1.05 KB
Contents
require 'awesome_spawn' module ManageIQ module ApplianceConsole # Kerberos principal class Principal attr_accessor :ca_name attr_accessor :hostname attr_accessor :realm attr_accessor :service # kerberos principal name attr_accessor :name def initialize(options = {}) options.each { |n, v| public_send("#{n}=", v) } @ca_name ||= "ipa" @realm = @realm.upcase if @realm @name ||= "#{service}/#{hostname}@#{realm}" end def register request if ipa? && !exist? end def subject_name "CN=#{hostname},OU=#{service},O=#{realm}" end def ipa? @ca_name == "ipa" end private def exist? AwesomeSpawn.run("/usr/bin/ipa", :params => ["-e", "skip_version_check=1", "service-find", "--principal", name]).success? end def request # using --force because these services tend not to be in dns # this is like VERIFY_NONE AwesomeSpawn.run!("/usr/bin/ipa", :params => ["-e", "skip_version_check=1", "service-add", "--force", name]) end end end end
Version data entries
48 entries across 48 versions & 1 rubygems