sudo in installer

This commit is contained in:
Antonio J. Delgado 2023-11-28 09:50:07 +02:00
parent ab62c873f1
commit 990b416c3a
2 changed files with 2 additions and 2 deletions

View file

@ -179,7 +179,7 @@ class mastodon (
} }
exec { 'install_ruby': exec { 'install_ruby':
command => '/usr/local/bin/install_ruby.sh', command => '/usr/local/bin/install_ruby.sh',
user => $mastodon_user, # user => $mastodon_user,
# cwd => "${mastodon_home}/.rbenv/", # cwd => "${mastodon_home}/.rbenv/",
creates => "${mastodon_home}/.rbenv/versions/3.2.2/bin/ruby", creates => "${mastodon_home}/.rbenv/versions/3.2.2/bin/ruby",
require => File['/usr/local/bin/install_ruby.sh'], require => File['/usr/local/bin/install_ruby.sh'],

View file

@ -3,5 +3,5 @@ set -euo pipefail
if [ ! -e '<%= @mastodon_home %>/.rbenv/versions/<%= @ruby_version %>/bin/ruby' ]; then if [ ! -e '<%= @mastodon_home %>/.rbenv/versions/<%= @ruby_version %>/bin/ruby' ]; then
cd '<%= @mastodon_home %>' cd '<%= @mastodon_home %>'
RUBY_CONFIGURE_OPTS=--with-jemalloc ./.rbenv/bin/rbenv install '<%= @ruby_version %>' sudo -u <%= @mastodon_user %> RUBY_CONFIGURE_OPTS=--with-jemalloc ./.rbenv/bin/rbenv install '<%= @ruby_version %>'
fi fi