projects
/
mirror
/
dsa-puppet.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
move to stringifying our facts again
[mirror/dsa-puppet.git]
/
modules
/
debian-org
/
lib
/
facter
/
onion-services.rb
1
begin
2
require 'json'
3
4
Facter.add("onion_hostname") do
5
services = {}
6
7
Dir['/var/lib/tor/onion/*/hostname'].each do |p|
8
dir = File.dirname(p)
9
service = File.basename(dir)
10
hostname = IO.read(p).chomp
11
services[service] = hostname
12
end
13
setcode do
14
services.to_json
15
end
16
end
17
18
rescue Exception => e
19
end