Project

General

Profile

« Previous | Next » 

Revision 6b7d827c

Added by Ewoud Kohl van Wijngaarden about 4 years ago

Move certificate setup to the acceptance helper

This avoids generating certificates for every example and makes the
examples easier.

View differences:

spec/acceptance/foreman_statsd_spec.rb
}
}
$directory = '/etc/foreman'
$directory = '/etc/foreman-certs'
$certificate = "${directory}/certificate.pem"
$key = "${directory}/key.pem"
exec { 'Create certificate directory':
command => "mkdir -p ${directory}",
path => ['/bin', '/usr/bin'],
creates => $directory,
} ->
exec { 'Generate certificate':
command => "openssl req -nodes -x509 -newkey rsa:2048 -subj '/CN=${facts['fqdn']}' -keyout '${key}' -out '${certificate}' -days 365",
path => ['/bin', '/usr/bin'],
creates => $certificate,
umask => '0022',
} ->
file { [$key, $certificate]:
owner => 'root',
group => 'root',
mode => '0640',
} ->
class { '::foreman':
class { 'foreman':
user_groups => [],
initial_admin_username => 'admin',
initial_admin_password => 'changeme',

Also available in: Unified diff