cdn-ops/global/overlay/etc/puppet/modules/cdn/manifests/db.pp

37 lines
900 B
ObjectPascal
Raw Normal View History

# 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':
content => template('cdn/db/docker-compose.yml.erb'),
2024-11-13 12:33:18 +00:00
service_name => 'cdn-db',
compose_dir => '/opt/sunet-cdn/compose',
compose_filename => 'docker-compose.yml',
description => 'SUNET CDN DB',
}
}