diff options
-rw-r--r-- | lib/puppet/parser/functions/ssh_keygen.rb | 3 | ||||
-rw-r--r-- | manifests/init.pp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/puppet/parser/functions/ssh_keygen.rb b/lib/puppet/parser/functions/ssh_keygen.rb index b732b87..87a3452 100644 --- a/lib/puppet/parser/functions/ssh_keygen.rb +++ b/lib/puppet/parser/functions/ssh_keygen.rb @@ -19,7 +19,8 @@ Puppet::Parser::Functions::newfunction(:ssh_keygen, :type => :rvalue, :doc => FileUtils.mkdir_p(dir, :mode => 0700) end unless [private_key_path,public_key_path].all?{|path| File.exists?(path) } - output = Puppet::Util::Execution.execute( + executor = (Facter.value(:puppetversion).to_i < 3) ? Puppet::Util : Puppet::Util::Execution + output = executor.execute( ['/usr/bin/ssh-keygen','-t', 'rsa', '-b', '4096', '-f', private_key_path, '-P', '', '-q']) raise Puppet::ParseError, "Something went wrong during key generation! Output: #{output}" unless output.empty? diff --git a/manifests/init.pp b/manifests/init.pp index 5a38293..666b5ac 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -28,7 +28,7 @@ class sshd( $hostbased_authentication = 'no', $permit_empty_passwords = 'no', $authorized_keys_file = $::osfamily ? { - Debian => $::operatingsystemmajrelease ? { + Debian => $::lsbmajdistrelease ? { 6 => '%h/.ssh/authorized_keys', default => '%h/.ssh/authorized_keys %h/.ssh/authorized_keys2', }, |