Add custom functions for determining some PE settings
Added a function to find the hostname and port of the classifier Added a fucntion to return all puppetdb hostnames
This commit is contained in:
parent
a9d3be58aa
commit
63429fe9ec
@ -0,0 +1,5 @@
|
||||
module Puppet::Parser::Functions
|
||||
newfunction(:puppet_master_classifer_settings, :type => :rvalue) do |args|
|
||||
function_parseyaml([function_file([File.join(lookupvar('settings::confdir').to_s, 'classifier.yaml')])])
|
||||
end
|
||||
end
|
@ -0,0 +1,12 @@
|
||||
require 'puppet/util/puppetdb'
|
||||
|
||||
module Puppet::Parser::Functions
|
||||
newfunction(:puppetdb_hostnames, :type => :rvalue) do |args|
|
||||
output = []
|
||||
Puppet::Util::Puppetdb.config.server_urls.each do | server_url |
|
||||
output << server_url.hostname
|
||||
end
|
||||
|
||||
output
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user