2023-02-13 09:44:56 +00:00
|
|
|
#Class for SUNET-Drive-Lookup-Server
|
|
|
|
class sunetdrive::reva (
|
2023-09-26 12:15:59 +00:00
|
|
|
String $domain = 'drive.test.sunet.se',
|
2023-09-26 12:26:07 +00:00
|
|
|
String $customer = 'sunet',
|
2023-09-26 12:15:59 +00:00
|
|
|
String $reva_domain = "${customer}-reva.${domain}",
|
2023-09-26 07:23:12 +00:00
|
|
|
String $reva_version = 'v1.26.0',
|
2023-02-13 09:44:56 +00:00
|
|
|
) {
|
|
|
|
|
|
|
|
$environment = sunetdrive::get_environment()
|
|
|
|
$shared_secret = safe_hiera('shared_secret')
|
2023-09-28 12:48:30 +00:00
|
|
|
$statistics_secret = safe_hiera('statistics_secret')
|
2023-02-13 09:44:56 +00:00
|
|
|
$iopsecret = safe_hiera('iopsecret')
|
2023-09-26 12:59:34 +00:00
|
|
|
$smtp_credentials = safe_hiera('smtp_credentials')
|
2023-02-13 09:44:56 +00:00
|
|
|
|
|
|
|
# Firewall settings
|
|
|
|
#Create users
|
|
|
|
user { 'www-data': ensure => present, system => true }
|
|
|
|
|
|
|
|
file { '/opt/reva/revad.toml':
|
|
|
|
ensure => present,
|
|
|
|
owner => 'www-data',
|
|
|
|
group => 'root',
|
|
|
|
content => template('sunetdrive/reva/revad.toml.erb'),
|
|
|
|
mode => '0644',
|
|
|
|
}
|
2023-09-28 12:48:30 +00:00
|
|
|
file { '/opt/reva/rclone.conf':
|
2023-02-13 09:44:56 +00:00
|
|
|
ensure => present,
|
|
|
|
owner => 'www-data',
|
|
|
|
group => 'root',
|
2023-09-28 12:48:30 +00:00
|
|
|
content => template('sunetdrive/reva/rclone.conf.erb'),
|
2023-02-13 09:44:56 +00:00
|
|
|
mode => '0644',
|
|
|
|
}
|
2023-09-28 12:48:30 +00:00
|
|
|
file { '/opt/reva/data':
|
|
|
|
ensure => directory,
|
|
|
|
owner => 'www-data',
|
|
|
|
}
|
2023-02-13 09:44:56 +00:00
|
|
|
sunet::docker_compose { 'drive_reva_docker_compose':
|
|
|
|
content => template('sunetdrive/reva/docker-compose.yml.erb'),
|
|
|
|
service_name => 'reva',
|
|
|
|
compose_dir => '/opt/',
|
|
|
|
compose_filename => 'docker-compose.yml',
|
|
|
|
description => 'Sciencemesh reva server',
|
|
|
|
}
|
2023-09-26 12:15:59 +00:00
|
|
|
$ports = [443,19000]
|
|
|
|
$ports.each | $port|{
|
|
|
|
sunet::misc::ufw_allow { "reva_${port}":
|
|
|
|
from => '0.0.0.0/0',
|
|
|
|
port => $port,
|
|
|
|
}
|
2023-02-13 09:44:56 +00:00
|
|
|
}
|
2023-09-26 12:15:59 +00:00
|
|
|
|
2023-02-13 09:44:56 +00:00
|
|
|
}
|