[chef] How to detect user does exist?


Chronological Thread 
  • From: Anthony Kong < >
  • To:
  • Subject: [chef] How to detect user does exist?
  • Date: Sun, 1 Mar 2015 09:42:11 +1100


Hi 

I have this definition on my cookbook

group "sensu" do

  action :modify

  members "vagrant"

  append true

end


it will throw an exception when I run it on ec2 because there is no user vagrant

How can I avoid the exception? Is there any way to detect the user exist? I have checked the doc https://docs.chef.io/resource_group.html but there is nothing obvious

Cheers,  



Archive powered by MHonArc 2.6.16.

§