Skip to content

Instantly share code, notes, and snippets.

@ssimeonov
Created June 26, 2013 03:04
Show Gist options
  • Save ssimeonov/5864454 to your computer and use it in GitHub Desktop.
Save ssimeonov/5864454 to your computer and use it in GitHub Desktop.
This gist shows how to make the Bluepill Chef cookbook use rvm. The trick is to subclass the provider in the Bluepill LWRP and override shell_out! to make it use rvm_shell instead.
class BluepillOverride
def self.provider
Class.new(Chef::Provider::BluepillService) do
def shell_out!(*args)
args.each do |command|
rvm_shell "#{command}" do
code command
end
end
end
end
end
end
bluepill_service 'my-service' do
provider BluepillOverride.provider
action [:enable, :load, :start]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment