Module: Puppetserver::Ca::Utils::Config

Defined in:
lib/puppetserver/ca/utils/config.rb

Class Method Summary collapse

Class Method Details

.munge_alt_names(names) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/puppetserver/ca/utils/config.rb', line 10

def self.munge_alt_names(names)
  raw_names = names.split(/\s*,\s*/).map(&:strip)
  munged_names = raw_names.map do |name|
    # Prepend the DNS tag if no tag was specified
    if !name.start_with?("IP:") && !name.start_with?("DNS:")
      "DNS:#{name}"
    else
      name
    end
  end.sort.uniq.join(", ")
end

.running_as_root?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/puppetserver/ca/utils/config.rb', line 6

def self.running_as_root?
  !Gem.win_platform? && Process::UID.eid == 0
end