fixed fact as centos doesn't seem to add the hostname to the hostkey, fixed package requirement
git-svn-id: https://svn/ipuppet/trunk/modules/sshd@1994 d66ca3ae-40d7-4aa7-90d4-87d79ca94279
This commit is contained in:
parent
e50ea57b58
commit
34bcb5c3d6
2 changed files with 4 additions and 3 deletions
|
@ -105,7 +105,7 @@ class sshd::base {
|
||||||
type => ssh-rsa,
|
type => ssh-rsa,
|
||||||
key => $sshrsakey_key,
|
key => $sshrsakey_key,
|
||||||
ensure => present,
|
ensure => present,
|
||||||
require => Package["openssh-client"],
|
require => Package["openssh-clients"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,10 +6,11 @@
|
||||||
value = nil
|
value = nil
|
||||||
filepath = File.join(dir,file)
|
filepath = File.join(dir,file)
|
||||||
if FileTest.file?(filepath)
|
if FileTest.file?(filepath)
|
||||||
regex = %r{^(\S+) (\S+) (\S+)$}
|
regex1 = %r{^(\S+) (\S+) (\S+)$}
|
||||||
|
regex2 = %r{^(\S+) (\S+)(\s+)$}
|
||||||
begin
|
begin
|
||||||
line = File.open(filepath).read.chomp
|
line = File.open(filepath).read.chomp
|
||||||
if match = regex.match(line)
|
if (match = regex1.match(line)) or (match = regex2.match(line))
|
||||||
value = match[2]
|
value = match[2]
|
||||||
end
|
end
|
||||||
rescue
|
rescue
|
||||||
|
|
Loading…
Reference in a new issue