Skip to content

Instantly share code, notes, and snippets.

@MattMencel
Last active November 17, 2016 15:44
Show Gist options
  • Save MattMencel/4f794f0b067365e98a3fc27b49347f6b to your computer and use it in GitHub Desktop.
Save MattMencel/4f794f0b067365e98a3fc27b49347f6b to your computer and use it in GitHub Desktop.
Upgrade Chef Client with Omnibus_Updater Cookbook on Raspberry Pi
# 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