diff --git a/manifests/init.pp b/manifests/init.pp index 18fa612..0f944f8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -9,10 +9,14 @@ # [*smtp_server*] # String with the SMTP server to use. # +# [*mastodon_home*] +# String path to Mastodon user home directory. Default /opt/mastodon +# class mastodon ( String $ensure = 'present', String $hostname = 'mastodon.example.org', - String $smtp_server = 'mail.example.org' + String $smtp_server = 'mail.example.org', + String $mastodon_home = '/opt/mastodon', ) { case $ensure { default: { @@ -84,4 +88,28 @@ class mastodon ( class { 'postgresql::server': } include redis + exec { 'enable_corepack': + command => '/usr/bin/corepack enable', + creates => '/usr/bin/yarn', + require => Class['nodejs'], + } + exec { 'yarn_classic': + command => '/usr/bin/yarn set version classic', + creates => '/root/.yarnrc', + require => Exec['enable_corepack'], + } + group { 'mastodon': } + user { 'mastodon': + gid => 'mastodon', + home => $mastodon_home, + managehome => true, + system => true, + require => Group['mastodon'], + } + vcsrepo { 'rbenv': + path => "${mastodon_home}/.rbenv", + source => 'https://github.com/rbenv/rbenv.git', + provider => 'git', + require => User['mastodon'], + } }