[chef] How to do conditional checks for gem installation?


Chronological Thread 
  • From: Sachin Sagar Rai < >
  • To: chef < >
  • Subject: [chef] How to do conditional checks for gem installation?
  • Date: Thu, 8 Mar 2012 15:31:55 +0545

Following installs the ruby gems on each chef-client run.

gems = %w(aws-sdk gist)
gems.each do |name|
  r = gem_package name do
    version node["dev_tools"]["#{name}_version"]
    action :nothing
  end

  r.run_action(:install)
end

How to apply the `not_if` conditional checking for the `r.run_action(:install)` action?

-------------------------------------------
@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow




Archive powered by MHonArc 2.6.16.

§