begin
require 'json'
- Facter.add("onion_hostname") do
+ Facter.add("onion_tor_service_hostname") do
services = {}
Dir['/var/lib/tor/onion/*/hostname'].each do |p|
end
end
- Facter.add("onionbalance_hostname") do
+ Facter.add("onion_balance_service_hostname") do
services = {}
Dir['/etc/onionbalance/private_keys/*.key'].each do |p|
) {
include onion::balance
- $onion_hn = onionbalance_hostname($name)
+ $onion_hn = onion_balance_service_hostname($name)
if ! $onion_hn {
exec { "create-onionbalance-key-${name}":
command => "/bin/true && umask 0027 && openssl genrsa -out /etc/onionbalance/private_keys/${name}.key 1024 && chgrp onionbalance /etc/onionbalance/private_keys/${name}.key",
content => "HiddenServiceDir /var/lib/tor/onion/${name}\nHiddenServicePort ${port} ${target_address}:${target_port}\n\n",
}
- $onion_hn = onion_hostname($name)
+ $onion_hn = onion_tor_service_hostname($name)
if $onion_hn {
$hostname_without_onion = regsubst($onion_hn, '\.onion$', '')
@@concat::fragment { "onion::balance::instance::$name::$fqdn":
--- /dev/null
+module Puppet::Parser::Functions
+ newfunction(:onion_balance_service_hostname, :type => :rvalue) do |args|
+ servicename = args.shift()
+
+ onion_balance_service_hostname_fact = lookupvar('onion_balance_service_hostname')
+
+ require 'json'
+ parsed = JSON.parse(onion_balance_service_hostname_fact)
+ return parsed[servicename]
+ end
+end
+# vim:set ts=2:
+# vim:set et:
+# vim:set shiftwidth=2:
+++ /dev/null
-module Puppet::Parser::Functions
- newfunction(:onion_hostname, :type => :rvalue) do |args|
- servicename = args.shift()
-
- onion_hostname_fact = lookupvar('onion_hostname')
-
- require 'json'
- parsed = JSON.parse(onion_hostname_fact)
- return parsed[servicename]
- end
-end
-# vim:set ts=2:
-# vim:set et:
-# vim:set shiftwidth=2:
--- /dev/null
+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:
+++ /dev/null
-module Puppet::Parser::Functions
- newfunction(:onionbalance_hostname, :type => :rvalue) do |args|
- servicename = args.shift()
-
- onionbalance_hostname_fact = lookupvar('onionbalance_hostname')
-
- require 'json'
- parsed = JSON.parse(onionbalance_hostname_fact)
- return parsed[servicename]
- end
-end
-# vim:set ts=2:
-# vim:set et:
-# vim:set shiftwidth=2: