From 0000f79db6b0c8e2714dc4edac22825c1bdc2cf1 Mon Sep 17 00:00:00 2001 From: Jeroen Jacobs Date: Wed, 23 Sep 2015 20:27:52 +0200 Subject: [PATCH 1/5] Puts download url into node attributes --- attributes/default.rb | 1 + recipes/default.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/attributes/default.rb b/attributes/default.rb index 6a1e162..492c40a 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -22,6 +22,7 @@ default['ruby_install']['version'] = '0.5.0' default['ruby_install']['checksum'] = 'aa4448c2c356510cc7c2505961961a17bd3f3435842831e04c8516eb703afd19' +default['ruby_install']['url'] = "https://codeload.github.com/postmodern/ruby-install/tar.gz/v#{node['ruby_install']['version']}" # Install rubies into /opt/rubies as expected by Chruby. default['ruby_install']['default_ruby_base_path'] = '/opt/rubies' diff --git a/recipes/default.rb b/recipes/default.rb index a6c7fe8..999f865 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -47,7 +47,7 @@ include_recipe 'ark' ark 'ruby_install' do - url "https://codeload.github.com/postmodern/ruby-install/tar.gz/v#{node['ruby_install']['version']}" # rubocop:disable LineLength + url node['ruby_install']['url'] extension 'tar.gz' checksum node['ruby_install']['checksum'] prefix_root '/tmp' # Don't need /usr/local/ruby-install From 8db360d6c13c7ff8827891010e3744aff8468e6d Mon Sep 17 00:00:00 2001 From: Jeroen Jacobs Date: Wed, 23 Sep 2015 20:29:01 +0200 Subject: [PATCH 2/5] Changes formatting in packages block in default recipe --- recipes/default.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/recipes/default.rb b/recipes/default.rb index 999f865..89ac42f 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -36,9 +36,9 @@ packages = %w{ libssl1.0.0 libssl1.0.0-dbg } end packages.each do |pkg| - package pkg do - action :upgrade - end + package pkg do + action :upgrade + end end when 'rhel' include_recipe 'yum' From ebef0f35130632ebe4193935f70821125fb20fc6 Mon Sep 17 00:00:00 2001 From: Jeroen Jacobs Date: Wed, 23 Sep 2015 20:29:25 +0200 Subject: [PATCH 3/5] Uses the chef file resource to change ownership of the binary --- recipes/default.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes/default.rb b/recipes/default.rb index 89ac42f..5b72f53 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -56,4 +56,7 @@ # Make sure ruby-install has correct ownership, Debian doesn't seem to use # group 'root' when it is installed unlike all the others including Ubuntu. -execute 'chown root:root /usr/local/bin/ruby-install' +file '/usr/local/bin/ruby-install' do + owner 'root' + group 'root' +end From 519e57763ddbbbf615f6ff864b3ecba87a73f141 Mon Sep 17 00:00:00 2001 From: Jeroen Jacobs Date: Wed, 23 Sep 2015 20:30:00 +0200 Subject: [PATCH 4/5] Correclty set the version for the ark resource --- recipes/default.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/default.rb b/recipes/default.rb index 5b72f53..c761b2d 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -51,6 +51,7 @@ extension 'tar.gz' checksum node['ruby_install']['checksum'] prefix_root '/tmp' # Don't need /usr/local/ruby-install + version node['ruby_install']['version'] action :install_with_make end From f1b6c2264616d51cf4568fef71d4415423d957f4 Mon Sep 17 00:00:00 2001 From: Jeroen Jacobs Date: Wed, 23 Sep 2015 20:30:10 +0200 Subject: [PATCH 5/5] Let ruby_install's source be in /usr/local --- recipes/default.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/default.rb b/recipes/default.rb index c761b2d..d06a075 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -50,7 +50,6 @@ url node['ruby_install']['url'] extension 'tar.gz' checksum node['ruby_install']['checksum'] - prefix_root '/tmp' # Don't need /usr/local/ruby-install version node['ruby_install']['version'] action :install_with_make end