Skip to content

Commit

Permalink
Use beaker DSL to generate puppet cert
Browse files Browse the repository at this point in the history
  • Loading branch information
mcanevet committed Mar 29, 2015
1 parent e116896 commit fca3c32
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def ldapsearch(cmd, exit_codes = [0,1], &block)
puts 'Sorry, this osfamily is not supported.'
exit
end
on host, 'puppet cert generate $(facter fqdn)'
end

RSpec.configure do |c|
Expand All @@ -43,15 +44,6 @@ def ldapsearch(cmd, exit_codes = [0,1], &block)
# Set up Certificates
pp = <<-EOS
$ssldir = '/var/lib/puppet/ssl'
Exec {
path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
exec { "puppet cert generate ${::fqdn}":
creates => [
"${ssldir}/private_keys/${::fqdn}.pem",
"${ssldir}/certs/${::fqdn}.pem",
],
}
file { '/etc/ldap':
ensure => directory,
}
Expand All @@ -66,10 +58,8 @@ def ldapsearch(cmd, exit_codes = [0,1], &block)
->
exec { "certtool -k < ${ssldir}/private_keys/${::fqdn}.pem > /etc/ldap/ssl/${::fqdn}.key":
creates => "/etc/ldap/ssl/${::fqdn}.key",
require => [
File['/etc/ldap/ssl'],
Exec["puppet cert generate ${::fqdn}"],
],
path => $::path,
require => File['/etc/ldap/ssl'],
before => File["/etc/ldap/ssl/${::fqdn}.key"],
}
} else {
Expand Down

0 comments on commit fca3c32

Please sign in to comment.