From 990b416c3a093e3e7c5f07d7ebb42afac0878530 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Tue, 28 Nov 2023 09:50:07 +0200 Subject: [PATCH] sudo in installer --- manifests/init.pp | 2 +- templates/install_ruby.sh.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 1bcb5bf..720abe5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -179,7 +179,7 @@ class mastodon ( } exec { 'install_ruby': command => '/usr/local/bin/install_ruby.sh', - user => $mastodon_user, + # user => $mastodon_user, # cwd => "${mastodon_home}/.rbenv/", creates => "${mastodon_home}/.rbenv/versions/3.2.2/bin/ruby", require => File['/usr/local/bin/install_ruby.sh'], diff --git a/templates/install_ruby.sh.erb b/templates/install_ruby.sh.erb index 77b9a1e..258e948 100644 --- a/templates/install_ruby.sh.erb +++ b/templates/install_ruby.sh.erb @@ -3,5 +3,5 @@ set -euo pipefail if [ ! -e '<%= @mastodon_home %>/.rbenv/versions/<%= @ruby_version %>/bin/ruby' ]; then 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