9
0
Fork 1
soc-ops/global/overlay/etc/puppet/modules/soc/manifests/vuln_dashboard.pp
Valerio Lomanto 31f5475e1c
feat: use env-file templating instead of composefile
use the same composefile as in the repo, passing configuration options
by using a templated env file instead of templating a custom composefile.
2024-12-17 15:26:54 +01:00

50 lines
1.5 KiB
Puppet

class soc::vuln_dashboard(
String $allowed_hosts = $facts['networking']['fqdn'],
String $docker_network = 'default',
String $docker_tag = 'latest',
String $db_datadir = '/opt/vuln-dashboard/dbdata',
String $pocs_storage_dir = '/opt/vuln-dashboard/pocsdata',
String $sso_service_name = 'dashboard-dev',
) {
$db_name=lookup('vuln-dashboard.dn_name', undef, undef, 'sunet')
$db_user=lookup('vuln-dashboard.db_user', undef, undef, 'playground')
$db_pass=lookup('vuln-dashboard.db_pass', undef, undef, 'password')
$db_port=lookup('vuln-dashbaord.db_port', undef, undef, '5432')
$db_host=lookup('vuln-dashboard.db_host', undef, undef, 'postgres')
$censys_api_secret=lookup('vuln-dashboard.censys_api_secret', undef, undef, 'null')
$censys_api_id=lookup('vuln-dashboard.censys.api_id', undef, undef, 'null')
file {
'/opt/vuln-dashboard':
ensure => directory,
;
$db_datadir:
ensure => directory,
;
$pocs_storage_dir:
ensure => directory,
;
'/opt/vuln-dashboard/docker-compose.yml':
ensure => file,
mode => '0600',
;
'/opt/vuln-dashboard/docker.env':
ensure => file,
mode => '0600',
content => template('soc/vuln-dashboard/docker.env.erb'),
;
}
utils::docker_compose_service_env { 'vuln-dashboard':
compose_file => '/opt/vuln-dashboard/docker-compose.yml',
description => 'SOC vuln dashboard',
envfile => '/opt/vuln-dashboard/docker.env',
docker_svc_names => 'dev postgres',
service_name => 'vuln-dashboard',
}
}