Created
June 26, 2013 03:04
-
-
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.
This file contains hidden or 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
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 |
This file contains hidden or 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
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