X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fpuppetmaster%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fonion_tor_service_hostname.rb;fp=modules%2Fpuppetmaster%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fonion_tor_service_hostname.rb;h=4d17eb2986c85d41c8975546e119e90e1955f75e;hb=705850831e5b2cea9d62f92bb6d234e87572e326;hp=0000000000000000000000000000000000000000;hpb=5712e0084ff0cf829d43268c975b1e88ce7b653e;p=mirror%2Fdsa-puppet.git diff --git a/modules/puppetmaster/lib/puppet/parser/functions/onion_tor_service_hostname.rb b/modules/puppetmaster/lib/puppet/parser/functions/onion_tor_service_hostname.rb new file mode 100644 index 000000000..4d17eb298 --- /dev/null +++ b/modules/puppetmaster/lib/puppet/parser/functions/onion_tor_service_hostname.rb @@ -0,0 +1,14 @@ +module Puppet::Parser::Functions + newfunction(:onion_tor_service_hostname, :type => :rvalue) do |args| + servicename = args.shift() + + onion_tor_service_hostname_fact = lookupvar('onion_tor_service_hostname') + + require 'json' + parsed = JSON.parse(onion_tor_service_hostname_fact) + return parsed[servicename] + end +end +# vim:set ts=2: +# vim:set et: +# vim:set shiftwidth=2: