Class: Puppet::Application::Query

Inherits:
FaceBase
  • Object
show all
Defined in:
lib/puppet/application/query.rb

Class Method Summary collapse

Class Method Details

.settingObject

[View source]

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/puppet/application/query.rb', line 4

def self.setting
  begin
    require 'puppet'
    require 'puppet/util/puppetdb'
    host = Puppet::Util::Puppetdb.server || 'puppetdb'
    port = Puppet::Util::Puppetdb.port || 8081
  rescue Exception => e
    Puppet.debug(e.message)
    host = 'puppetdb'
    port = 8081
  end

  Puppet.debug(host)
  Puppet.debug(port)

  { :host => host,
    :port => port }
end