Last active
November 17, 2016 15:44
-
-
Save MattMencel/4f794f0b067365e98a3fc27b49347f6b to your computer and use it in GitHub Desktop.
Upgrade Chef Client with Omnibus_Updater Cookbook on Raspberry Pi
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
# base chef-client has already been installed via package mgmt or git | |
package 'libgmp3-dev' do | |
# required for libyajl gem which is required for chef gem | |
action :upgrade | |
end | |
# Pull chef repo so we can build the omnibus packages | |
git '/usr/local/src/chef' do | |
repository 'https://github.com/chef/chef.git' | |
reference "v#{node[:omnibus_updater][:version]}" | |
action :sync | |
notifies :run, 'execute[bundle install]', :immediately | |
end | |
execute 'bundle install' do | |
command 'bundle install --without development' | |
cwd '/usr/local/src/chef/omnibus' | |
action :nothing | |
end | |
execute 'bundle exec' do | |
command 'bundle exec omnibus build chef' | |
cwd '/usr/local/src/chef/omnibus' | |
action :nothing | |
subscribes :run, 'execute[bundle install]', :immediately | |
end | |
node.set[:omnibus_updater][:direct_url] = 'file://' + Dir.glob('/usr/local/src/chef/omnibus/pkg/*.deb').max_by {|f| File.mtime(f)} | |
include_recipe 'omnibus_updater' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment