sunetdrive/manifests/onlyoffice.pp

30 lines
1.1 KiB
ObjectPascal
Raw Permalink Normal View History

2023-02-13 09:44:56 +00:00
#Class for SUNET-Drive-OnlyOffice
class sunetdrive::onlyoffice () {
$environment = sunetdrive::get_environment()
$extra_hosts = hiera_hash($environment)['extra_hosts']
$docker_tag = hiera_hash($environment)['collabora_tag']
2023-10-10 08:26:43 +00:00
$token_name = 'Sunet'
$access_token = safe_hiera('collabora_access_token')
2023-02-13 09:44:56 +00:00
$customers = hiera('fullnodes')
$multinode_customers = keys(hiera_hash('multinode_mapping'))
if $environment == 'prod' {
$domain = 'drive.sunet.se'
} else {
$domain = 'drive.test.sunet.se'
}
2023-10-10 08:26:43 +00:00
exec { 'collabora_docker_login':
2023-10-10 08:33:28 +00:00
command => "docker login registry.gitlab.collabora.com -u ${token_name} -p ${access_token}",
2023-10-10 08:26:43 +00:00
}
2023-02-13 09:44:56 +00:00
sunet::collabora::docs { 'sunet-onlyoffice':
2024-10-09 12:23:08 +00:00
dns => [ '89.32.32.32' ],
extra_hosts => $extra_hosts,
2023-02-13 09:44:56 +00:00
extra_volumes => ['/opt/collabora/coolwsd.xml:/etc/coolwsd/coolwsd.xml'],
2024-10-09 12:23:08 +00:00
docker_tag => $docker_tag,
docker_image => 'registry.gitlab.collabora.com/productivity/collabora-online-nc',
2023-02-13 09:44:56 +00:00
}
file {'/opt/collabora/coolwsd.xml':
2024-10-09 12:23:08 +00:00
ensure => present,
2023-02-13 09:44:56 +00:00
content => template('sunetdrive/document/coolwsd.xml.erb'),
}
}