Last active
January 1, 2016 14:28
-
-
Save crhan/8157604 to your computer and use it in GitHub Desktop.
chef deploy rbenv and binary ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default["ops-oob"]["rbenv_tar"] = "rbenv_6u2.tar.gz" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rbenv setup | |
export RBENV_ROOT=/usr/local/rbenv | |
eval "$(rbenv init -)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case node['platform_version'] | |
when /5\./ | |
node.default["ops-oob"]["rbenv_tar"] = "rbenv_5u7.tar.gz" | |
when /6\./ | |
node.default["ops-oob"]["rbenv_tar"] = "rbenv_6u2.tar.gz" | |
end | |
package "libyaml" | |
pacakge "libffi" | |
group "rbenv" do | |
members "oob" | |
system true | |
append true | |
end | |
execute "wget http://172.24.102.200/download/rbenv/#{node["ops-oob"]["rbenv_tar"]} -O - | tar xzf - -C /usr/local/" do | |
not_if "test -d /usr/local/rbenv/" | |
end | |
link "/usr/local/bin/rbenv" do | |
to "/usr/local/rbenv/bin/rbenv" | |
end | |
cookbook_file "rbenv.profile.sh" do | |
path "/etc/profile.d/rbenv.sh" | |
mode 00755 | |
end | |
execute "correct rbenv ownership and mod" do | |
command 'find /usr/local/rbenv -type d -and \( -not -perm /2000 -or -not -group rbenv \) -exec chmod g+Xs {} \; -exec chown :rbenv {} \;' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment