1 # This function returns the .onion name for a given service name on Debian's onionbalance instance
2 # for this, it reads /srv/puppet.debian.org/puppet-facts/onionbalance-services.yaml
3 # this comes from the onionbalance-host, via puppet's storedconf
5 module Puppet::Parser::Functions
6 newfunction(:onion_global_service_hostname, :type => :rvalue) do |args|
7 servicename = args.shift()
9 fn = '/srv/puppet.debian.org/puppet-facts/onionbalance-services.yaml'
10 unless File.exist?(fn)
17 parsed = JSON.parse(facts)
18 return parsed[servicename]
23 # vim:set shiftwidth=2: