puppet-cgit/spec/acceptance/fixtures/preconditions.pp
Glauco Oliveira 6c36488c23 Add acceptance tests for puppet-cgit
Add acceptance tests for puppet-cgit module so that once the module is
applied we check if files were created, packages were installed and
services were started.

Co-Authored-By: Bruno Tavares <btavare@thoughtworks.com>
Co-Authored-By: Danilo Ramalho <dramalho@thoughtworks.com>

Change-Id: I8d12999b6d91f1ab67fa16d6bbd8bc1d2efa3a05
2015-09-15 16:39:47 -03:00

34 lines
1.2 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/certs/cgit.key', '/etc/cgit/ssl/cgit.crt'],
}
package { 'policycoreutils-python':
ensure => present,
}
}
elsif ($::osfamily == 'Debian') {
package { 'ssl-cert':
ensure => present,
}
}