Added amanda module
This commit is contained in:
parent
1389ec553e
commit
8217a3b0f8
3 changed files with 126 additions and 0 deletions
27
amanda/lib/facter/amanda.rb
Normal file
27
amanda/lib/facter/amanda.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
Facter.add('amanda_serverkey') do
|
||||
setcode do
|
||||
begin
|
||||
match = File.read('/var/lib/amanda/.ssh/id_rsa_amdump.pub')[/^ssh-rsa ([^ ]+)/, 1]
|
||||
if match
|
||||
data = match
|
||||
end
|
||||
rescue
|
||||
data = ''
|
||||
end
|
||||
data
|
||||
end
|
||||
end
|
||||
|
||||
Facter.add('amanda_clientkey') do
|
||||
setcode do
|
||||
begin
|
||||
match = File.read('/var/lib/amanda/.ssh/id_rsa_amrecover.pub')[/^ssh-rsa ([^ ]+)/, 1]
|
||||
if match
|
||||
data = match
|
||||
end
|
||||
rescue
|
||||
data = ''
|
||||
end
|
||||
data
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue