puppet-cgit/spec/acceptance/fixtures/preconditions.pp
Bruno Tavares d62bb692ad Move test assertions closer to apply.
As discussed on another project patches when introducing tests[1], we
would like to keep the tests closer to the where we apply the spec.

This change makes the testing structure consistent to the feedback given
on puppet-bandersnatch discussion.

[1] https://review.openstack.org/#/c/221941/

Change-Id: I12b50747b9a8e40fe76af25f54b734f6239ff425
Co-Authored-By: Danilo Ramalho <dramalho@thoughtworks.com>
2015-09-24 20:41:47 -03:00

42 lines
1.3 KiB
Puppet

# Installing ssl-cert in order to get snakeoil certs
if ($::osfamily == 'RedHat' and $::operatingsystemmajrelease == '7') {
exec { 'creates self-signed certificate directory':
path => '/usr/bin',
command => 'mkdir -p /etc/ssl/certs',
creates => '/etc/ssl/certs',
}
exec { 'creates self-signed certificate key directory':
path => '/usr/bin',
command => 'mkdir -p /etc/ssl/private',
creates => '/etc/ssl/private',
}
exec { 'creates self-signed certificate':
path => '/usr/bin',
command => 'openssl req \
-new \
-newkey rsa:2048 \
-days 365 \
-nodes \
-x509 \
-subj "/C=US/ST=California/L=San Francisco/O=Dis/CN=localhost" \
-keyout /etc/ssl/private/ssl-cert-snakeoil.key \
-out /etc/ssl/certs/ssl-cert-snakeoil.pem',
creates => ['/etc/ssl/private/ssl-cert-snakeoil.key', '/etc/ssl/certs/ssl-cert-snakeoil.pem'],
require => [
Exec['creates self-signed certificate directory'],
Exec['creates self-signed certificate key directory'],
],
}
package { 'policycoreutils-python':
ensure => present,
}
}
elsif ($::osfamily == 'Debian') {
package { 'ssl-cert':
ensure => present,
}
}