diff options
author | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2015-01-15 17:09:56 -0500 |
---|---|---|
committer | Jerome Charaoui <jcharaoui@cmaisonneuve.qc.ca> | 2015-01-15 17:09:56 -0500 |
commit | 1e4f46a35b666980de6f55da121dc455b70d80bb (patch) | |
tree | 88e09fcd60322f3a60a0ebd29c866fa5242e228c /lib/puppet/parser | |
parent | 45892056cd0d33dd652429cc4ab82a893d444ef7 (diff) | |
download | puppet-sshd-1e4f46a35b666980de6f55da121dc455b70d80bb.tar.gz puppet-sshd-1e4f46a35b666980de6f55da121dc455b70d80bb.tar.bz2 |
Fix ssh_keygen for Puppet < 3 installs
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r-- | lib/puppet/parser/functions/ssh_keygen.rb | 3 |
1 files changed, 2 insertions, 1 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? |