diff options
| author | Silvio Rhatto <rhatto@riseup.net> | 2013-01-17 21:43:33 -0200 |
|---|---|---|
| committer | Silvio Rhatto <rhatto@riseup.net> | 2013-01-17 21:43:33 -0200 |
| commit | ca79037957522708830ae159b6cc7a05edbac340 (patch) | |
| tree | e645830cf13393af8b0ad5e097bb260ded2ef20e /lib/facter/sshkeys.rb | |
| parent | 85d7fc922011bc2a619f0e093b69f0a37a88f59c (diff) | |
| parent | 576bbf09d8516809d7373dc9b4e725ce2151a463 (diff) | |
| download | puppet-sshd-ca79037957522708830ae159b6cc7a05edbac340.tar.gz puppet-sshd-ca79037957522708830ae159b6cc7a05edbac340.tar.bz2 | |
Merge branch 'master' of git://labs.riseup.net/shared-sshd
Conflicts:
templates/sshd_config/Ubuntu_precise.erb
Diffstat (limited to 'lib/facter/sshkeys.rb')
| -rw-r--r-- | lib/facter/sshkeys.rb | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/lib/facter/sshkeys.rb b/lib/facter/sshkeys.rb deleted file mode 100644 index 0e94a03..0000000 --- a/lib/facter/sshkeys.rb +++ /dev/null @@ -1,45 +0,0 @@ -["/etc/ssh","/usr/local/etc/ssh","/etc","/usr/local/etc"].each { |dir| - {"SSHDSAKey_key" => "ssh_host_dsa_key.pub", - "SSHRSAKey_key" => "ssh_host_rsa_key.pub"}.each { |name,file| - Facter.add(name ) do - setcode do - value = nil - filepath = File.join(dir,file) - if FileTest.file?(filepath) - regex1 = %r{^(\S+) (\S+) (\S+)$} - regex2 = %r{^(\S+) (\S+)(\s+)$} - begin - line = File.open(filepath).read.chomp - if (match = regex1.match(line)) or (match = regex2.match(line)) - value = match[2] - end - rescue - value = nil - end - end - value - end # end of proc - end # end of add - } # end of hash each - {"SSHDSAKey_comment" => "ssh_host_dsa_key.pub", - "SSHRSAKey_comment" => "ssh_host_rsa_key.pub"}.each { |name,file| - Facter.add(name ) do - setcode do - value = nil - filepath = File.join(dir,file) - if FileTest.file?(filepath) - regex = %r{^(\S+) (\S+) (\S+)$} - begin - line = File.open(filepath).read.chomp - if match = regex.match(line) - value = match[3] - end - rescue - value = nil - end - end - value - end # end of proc - end # end of add - } # end of hash each -} # end of dir each |
