2024-10-03 18:12:59 +00:00
|
|
|
# Configure the SUNET CDN forgejo runner
|
|
|
|
class cdn::runner(
|
|
|
|
)
|
|
|
|
{
|
|
|
|
$runner_token = lookup({ 'name' => 'runner_token', 'default_value' => undef })
|
|
|
|
|
|
|
|
if $runner_token {
|
|
|
|
|
|
|
|
file { '/opt/forgejo-runner':
|
|
|
|
ensure => directory,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0750',
|
|
|
|
}
|
|
|
|
|
2024-10-03 18:57:28 +00:00
|
|
|
# The owner/group matches 'user' in compose file for runner
|
2024-10-03 18:12:59 +00:00
|
|
|
file { '/opt/forgejo-runner/data':
|
|
|
|
ensure => directory,
|
2024-10-03 18:57:28 +00:00
|
|
|
owner => '1001',
|
|
|
|
group => '1001',
|
2024-10-03 18:12:59 +00:00
|
|
|
mode => '0750',
|
|
|
|
}
|
|
|
|
|
|
|
|
file { '/opt/forgejo-runner/data/seccomp.json':
|
|
|
|
ensure => file,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0640',
|
|
|
|
content => template('cdn/runner/seccomp.json.erb'),
|
|
|
|
}
|
|
|
|
|
|
|
|
file { '/opt/forgejo-runner/docker_certs':
|
|
|
|
ensure => directory,
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0750',
|
|
|
|
}
|
|
|
|
|
|
|
|
sunet::docker_compose { 'sunet-cdn-runner':
|
|
|
|
content => template('cdn/runner/docker-compose.yml.erb'),
|
|
|
|
service_name => 'cdn-runner',
|
|
|
|
compose_dir => '/opt/sunet-cdn/compose/runner',
|
|
|
|
compose_filename => 'docker-compose.yml',
|
|
|
|
description => 'SUNET CDN forgejo runner',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|