diff --git a/site-modules/profile/manifests/hedgedoc.pp b/site-modules/profile/manifests/hedgedoc.pp --- a/site-modules/profile/manifests/hedgedoc.pp +++ b/site-modules/profile/manifests/hedgedoc.pp @@ -1,12 +1,6 @@ # deploy a hedgedoc instance class profile::hedgedoc { - - $packages = [ - 'npm', 'yarn', 'node-gyp' - ] - - $keyid = lookup('yarn::apt_config::keyid') - $key = lookup('yarn::apt_config::key') + include profile::hedgedoc::apt_config # ---- configuration $user = lookup('hedgedoc::user') @@ -53,20 +47,6 @@ $service_name = "hedgedoc" $unit_name = "${service_name}.service" - apt::source { 'yarn': - location => "https://dl.yarnpkg.com/debian/", - release => 'stable', - repos => 'main', - key => { - id => $keyid, - content => $key, - }, - } -> - package { $packages: - ensure => present, - notify => Archive['hedgedoc'], - } - file { $install_path: ensure => 'directory', owner => $user, @@ -140,7 +120,7 @@ enable => true, require => [ Systemd::Unit_file[$unit_name], - Package[$packages], + Class['profile::hedgedoc::apt_config'], Archive['hedgedoc'], ], } diff --git a/site-modules/profile/manifests/hedgedoc/apt_config.pp b/site-modules/profile/manifests/hedgedoc/apt_config.pp new file mode 100644 --- /dev/null +++ b/site-modules/profile/manifests/hedgedoc/apt_config.pp @@ -0,0 +1,23 @@ +# APT configuration for hedgedoc +class profile::hedgedoc::apt_config { + $packages = [ + 'npm', 'yarn', 'node-gyp' + ] + + $keyid = lookup('yarn::apt_config::keyid') + $key = lookup('yarn::apt_config::key') + + apt::source { 'yarn': + location => "https://dl.yarnpkg.com/debian/", + release => 'stable', + repos => 'main', + key => { + id => $keyid, + content => $key, + }, + } -> + package { $packages: + ensure => present, + notify => Archive['hedgedoc'], + } +}