git.lirion.de

Of git, get, and gud

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--site/puppet_master_classifer_settings_function/lib/puppet/parser/functions/puppet_master_classifer_settings.rb5
-rw-r--r--site/puppetdb_hostname_function/lib/puppet/parser/functions/puppetdb_hostname.rb12
2 files changed, 17 insertions, 0 deletions
diff --git a/site/puppet_master_classifer_settings_function/lib/puppet/parser/functions/puppet_master_classifer_settings.rb b/site/puppet_master_classifer_settings_function/lib/puppet/parser/functions/puppet_master_classifer_settings.rb
new file mode 100644
index 0000000..5559849
--- /dev/null
+++ b/site/puppet_master_classifer_settings_function/lib/puppet/parser/functions/puppet_master_classifer_settings.rb
@@ -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
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