Set up an instance of Mastodon for Kosmos
Refs #19 Use new application cookbook, update our cookbooks
This commit is contained in:
54
site-cookbooks/kosmos-ruby/recipes/default.rb
Normal file
54
site-cookbooks/kosmos-ruby/recipes/default.rb
Normal file
@@ -0,0 +1,54 @@
|
||||
#
|
||||
# Cookbook Name:: kosmos-ruby
|
||||
# Recipe:: default
|
||||
#
|
||||
# Copyright 2017, Kosmos
|
||||
#
|
||||
# All rights reserved - Do Not Redistribute
|
||||
#
|
||||
|
||||
package_name = "ruby#{node['kosmos-ruby']['version']}"
|
||||
|
||||
apt_repository 'brightbox_ruby' do
|
||||
uri 'http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu'
|
||||
distribution node['lsb']['codename']
|
||||
components ['main']
|
||||
keyserver 'keyserver.ubuntu.com'
|
||||
key '80F70E11F0F0D5F10CB20E62F5DA5F09C3173AA6'
|
||||
end
|
||||
|
||||
packages = [
|
||||
"ruby#{node['kosmos-ruby']['version']}",
|
||||
"ruby#{node['kosmos-ruby']['version']}-dev",
|
||||
"build-essential",
|
||||
"libssl-dev",
|
||||
"zlib1g-dev"
|
||||
]
|
||||
|
||||
apt_package packages do
|
||||
action :install
|
||||
end
|
||||
|
||||
apt_package 'ruby-switch' do
|
||||
action :install
|
||||
notifies :run, 'execute[set default ruby]', :immediately
|
||||
end
|
||||
|
||||
execute 'set default ruby' do
|
||||
command "ruby-switch --set #{package_name}"
|
||||
action :nothing
|
||||
notifies :reload, 'ohai[reload]', :immediately
|
||||
end
|
||||
|
||||
ohai 'reload' do
|
||||
action :nothing
|
||||
end
|
||||
|
||||
execute 'update rubygems' do
|
||||
command 'gem update --system 2.6.8'
|
||||
not_if "gem --version | grep ^2.6.8$"
|
||||
end
|
||||
|
||||
gem_package "bundler" do
|
||||
version "1.13.2"
|
||||
end
|
||||
Reference in New Issue
Block a user