2024-10-07 06:35:00 +00:00
|
|
|
# Configure a SUNET CDN CA server
|
|
|
|
class cdn::ca(
|
|
|
|
)
|
|
|
|
{
|
|
|
|
|
2024-10-08 07:36:04 +00:00
|
|
|
$ca_secrets = lookup({ 'name' => 'cdn::ca-secrets', 'default_value' => undef })
|
|
|
|
|
|
|
|
file { '/opt/step-ca':
|
|
|
|
ensure => directory,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0755',
|
|
|
|
}
|
|
|
|
|
|
|
|
# The owner/group matches the 'step' user in the step-ca container
|
|
|
|
file { '/opt/step-ca/data':
|
|
|
|
ensure => directory,
|
|
|
|
owner => '1000',
|
|
|
|
group => '1000',
|
|
|
|
mode => '0750',
|
|
|
|
}
|
|
|
|
|
|
|
|
# Files used for initial install of step-ca
|
|
|
|
file { '/opt/step-ca/init':
|
|
|
|
ensure => directory,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0755',
|
|
|
|
}
|
|
|
|
|
|
|
|
file { '/opt/step-ca/init/secrets':
|
|
|
|
ensure => directory,
|
|
|
|
owner => '1000',
|
|
|
|
group => '1000',
|
|
|
|
mode => '0750',
|
|
|
|
}
|
|
|
|
|
2024-10-08 07:39:09 +00:00
|
|
|
if $ca_secrets {
|
|
|
|
if $ca_secrets['key_password'] {
|
|
|
|
file { '/opt/step-ca/init/secrets/key-password':
|
|
|
|
ensure => file,
|
|
|
|
owner => '1000',
|
|
|
|
group => '1000',
|
|
|
|
mode => '0640',
|
2024-10-08 07:51:08 +00:00
|
|
|
content => template('cdn/ca/key-password.erb'),
|
2024-10-08 07:39:09 +00:00
|
|
|
}
|
2024-10-08 07:36:04 +00:00
|
|
|
}
|
|
|
|
|
2024-10-08 07:39:09 +00:00
|
|
|
if $ca_secrets['provisioner_password'] {
|
|
|
|
file { '/opt/step-ca/init/secrets/provisioner-password':
|
|
|
|
ensure => file,
|
|
|
|
owner => '1000',
|
|
|
|
group => '1000',
|
|
|
|
mode => '0640',
|
2024-10-08 07:51:08 +00:00
|
|
|
content => template('cdn/ca/provisioner-password.erb'),
|
2024-10-08 07:39:09 +00:00
|
|
|
}
|
2024-10-08 07:36:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-07 06:35:00 +00:00
|
|
|
sunet::nftables::docker_expose { 'expose step-ca' :
|
|
|
|
allow_clients => 'any',
|
|
|
|
port => 9000,
|
|
|
|
iif => $facts['networking']['primary'],
|
|
|
|
}
|
|
|
|
|
|
|
|
# sunet::docker_compose { 'sunet-cdn-ca':
|
|
|
|
# content => template('cdn/ca/docker-compose.yml.erb'),
|
2024-10-08 07:36:04 +00:00
|
|
|
# service_name => 'cdn-ca',
|
2024-10-07 06:35:00 +00:00
|
|
|
# compose_dir => '/opt/sunet-cdn/compose',
|
|
|
|
# compose_filename => 'docker-compose.yml',
|
|
|
|
# description => 'SUNET CDN CA',
|
|
|
|
# }
|
|
|
|
}
|