git.lirion.de

Of git, get, and gud

summaryrefslogtreecommitdiffstats
path: root/site/puppetdb_hostname_function/lib
diff options
context:
space:
mode:
authormail_redacted_for_web 2015-11-11 13:52:20 -0800
committermail_redacted_for_web 2015-11-25 16:06:28 -0800
commit63429fe9ec595df70a39de0944d893134899211e (patch)
tree3a0c84b64f7f83972de112a1e586edf6a4927c04 /site/puppetdb_hostname_function/lib
parenta9d3be58aa816a0b909efa05cbb714c0e94c21be (diff)
downloadcontrol-repo-template-63429fe9ec595df70a39de0944d893134899211e.tar.bz2
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
Diffstat (limited to 'site/puppetdb_hostname_function/lib')
-rw-r--r--site/puppetdb_hostname_function/lib/puppet/parser/functions/puppetdb_hostname.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/site/puppetdb_hostname_function/lib/puppet/parser/functions/puppetdb_hostname.rb b/site/puppetdb_hostname_function/lib/puppet/parser/functions/puppetdb_hostname.rb
new file mode 100644
index 0000000..b43365f
--- /dev/null
+++ b/site/puppetdb_hostname_function/lib/puppet/parser/functions/puppetdb_hostname.rb
@@ -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