Module: SensuPuppetFacts

Defined in:
lib/facter/sensu_puppet_facts.rb

Class Method Summary collapse

Class Method Details

.add_factsObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/facter/sensu_puppet_facts.rb', line 4

def self.add_facts
  SensuPuppetFacts.init_settings
  Facter.add(:puppet_hostcert) do
    setcode do
      ::Puppet[:hostcert].to_s
    end
  end

  Facter.add(:puppet_hostprivkey) do
    setcode do
      ::Puppet[:hostprivkey].to_s
    end
  end

  Facter.add(:puppet_localcacert) do
    setcode do
      ::Puppet[:localcacert].to_s
    end
  end

  Facter.add(:puppet_hostcrl) do
    setcode do
      ::Puppet[:hostcrl].to_s
    end
  end
end

.init_settingsObject



31
32
33
34
35
# File 'lib/facter/sensu_puppet_facts.rb', line 31

def self.init_settings
  if ! ::Puppet.settings.global_defaults_initialized?
    ::Puppet.initialize_settings
  end
end