use install script
This commit is contained in:
parent
96e0408d0d
commit
a906ef2f57
2 changed files with 21 additions and 9 deletions
|
@ -156,16 +156,20 @@ class mastodon (
|
||||||
group => 'mastodon',
|
group => 'mastodon',
|
||||||
require => Vcsrepo['rbenv'],
|
require => Vcsrepo['rbenv'],
|
||||||
}
|
}
|
||||||
|
file { '/usr/local/bin/install_ruby.sh':
|
||||||
|
ensure => $ensure,
|
||||||
|
content => template('mastodon/install_ruby.sh.erb'),
|
||||||
|
mode => '0750',
|
||||||
|
owner => 'mastodon',
|
||||||
|
group => 'root',
|
||||||
|
require => Vcsrepo['ruby_build'],
|
||||||
|
}
|
||||||
exec { 'install_ruby':
|
exec { 'install_ruby':
|
||||||
command => "${mastodon_home}/.rbenv/bin/rbenv install 3.2.2",
|
command => '/usr/local/bin/install_ruby.sh',
|
||||||
path => "${mastodon_home}/.rbenv/bin:/usr/sbin:/usr/bin:/sbin:/bin",
|
user => 'mastodon',
|
||||||
environment => [
|
cwd => "${mastodon_home}/.rbenv/",
|
||||||
'RUBY_CONFIGURE_OPTS=--with-jemalloc',
|
creates => "${mastodon_home}/.rbenv/versions/3.2.2/bin/ruby",
|
||||||
],
|
require => File['/usr/local/bin/install_ruby.sh'],
|
||||||
user => 'mastodon',
|
|
||||||
cwd => "${mastodon_home}/.rbenv/",
|
|
||||||
creates => "${mastodon_home}/.rbenv/versions/3.2.2/bin/ruby",
|
|
||||||
require => Vcsrepo['ruby_build'],
|
|
||||||
}
|
}
|
||||||
# exec { 'set_global_ruby_version':
|
# exec { 'set_global_ruby_version':
|
||||||
# command => "${mastodon_home}/.rbenv/libexec/rbenv global 3.2.2",
|
# command => "${mastodon_home}/.rbenv/libexec/rbenv global 3.2.2",
|
||||||
|
|
8
templates/install_ruby.sh.erb
Normal file
8
templates/install_ruby.sh.erb
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
su mastodon
|
||||||
|
if [ ! -e "<%= @mastodon_home %>/.rbenv/versions/3.2.2/bin/ruby" ]; then
|
||||||
|
cd "<%= @mastodon_home %>"
|
||||||
|
RUBY_CONFIGURE_OPTS=--with-jemalloc "<%= @mastodon_home %>/.rbenv/bin/rbenv" install 3.2.2
|
||||||
|
fi
|
Loading…
Reference in a new issue