[chef] Dynamically determine the role that specified the recipe


Chronological Thread 
  • From: "Van Fossan,Randy" < >
  • To: < >
  • Subject: [chef] Dynamically determine the role that specified the recipe
  • Date: Sat, 4 Feb 2012 15:44:13 -0500

I have been looking through other cookbooks to figure out  a way to get
the name of the role from within a recipe and haven't found it.    I
need a way to automatically remove the role from the nodes run list
without knowing what that role name is in advance.    When the recipe is
run, it would figure out which role it was specified in.

I have successfully used node.role?("myrole") to remove a specified role
before.   However, I need to dynamically determine the role that
specified the cookbook::recipe and then remove that role from the run
list.

Thanks
  Randy




Archive powered by MHonArc 2.6.16.

§