Created
June 17, 2014 07:02
-
-
Save lamanotrama/1b721b2790cbabd7dc06 to your computer and use it in GitHub Desktop.
serverspecでfactsを使う
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
class Hash | |
def symbolize_keys | |
self.each_with_object({}){|(k,v),memo| memo[k.to_s.to_sym]=v} | |
end | |
end | |
facter_lib = ENV['SERVERSPEC_ENV'] == 'development' ? | |
'/vagrant/modules/heteml/lib' : '/usr/lib/puppuet/lib' | |
facts = backend.run_command( | |
%|FACTERLIB=#{facter_lib} /usr/bin/ruby -r facter -e 'p Facter.to_hash'| | |
).stdout | |
property = eval(facts).symbolize_keys | |
set_property property |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment