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 2016-01-05 13:27:26 -0800
committermail_redacted_for_web 2016-01-05 13:27:26 -0800
commit9a876a61e730f1c17063ad0593c3b37625503b5e (patch)
treec93741be83ef640c860297e0efe3bbb3d86bfca6 /site/puppetdb_hostname_function/lib
parenta9d3be58aa816a0b909efa05cbb714c0e94c21be (diff)
parent752f2ef87bb56895f5a63c89fd01fe0ed0c623be (diff)
downloadcontrol-repo-template-9a876a61e730f1c17063ad0593c3b37625503b5e.tar.bz2
Merge pull request #9 from npwalker/2015_3_prep
Changes for PE2015.3.0
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