2024-11-13 12:27:58 +00:00
|
|
|
# Configure a SUNET CDN DB server
|
|
|
|
class cdn::db(
|
|
|
|
String $postgres_version = '17.0-bookworm',
|
|
|
|
)
|
|
|
|
{
|
|
|
|
|
|
|
|
$db_secrets = lookup({ 'name' => 'cdn::db-secrets', 'default_value' => undef })
|
|
|
|
|
|
|
|
file { '/opt/sunet-cdn':
|
|
|
|
ensure => directory,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0755',
|
|
|
|
}
|
|
|
|
|
|
|
|
file { '/opt/sunet-cdn/compose':
|
|
|
|
ensure => directory,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0750',
|
|
|
|
}
|
|
|
|
|
|
|
|
sunet::nftables::docker_expose { 'expose postgres-db' :
|
|
|
|
allow_clients => '127.0.0.1',
|
|
|
|
port => 5432,
|
|
|
|
iif => $facts['networking']['primary'],
|
|
|
|
}
|
|
|
|
|
2024-11-13 12:33:18 +00:00
|
|
|
sunet::docker_compose { 'sunet-cdn-db':
|
2024-11-13 12:27:58 +00:00
|
|
|
content => template('cdn/db/docker-compose.yml.erb'),
|
2024-11-13 12:33:18 +00:00
|
|
|
service_name => 'cdn-db',
|
2024-11-13 12:27:58 +00:00
|
|
|
compose_dir => '/opt/sunet-cdn/compose',
|
|
|
|
compose_filename => 'docker-compose.yml',
|
|
|
|
description => 'SUNET CDN DB',
|
|
|
|
}
|
|
|
|
}
|