Revision 6b7d827c
Added by Ewoud Kohl van Wijngaarden about 4 years ago
spec/acceptance/foreman_rex_cockpit_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':
|
||
user_groups => [],
|
||
initial_admin_username => 'admin',
|
Also available in: Unified diff
Move certificate setup to the acceptance helper
This avoids generating certificates for every example and makes the
examples easier.