[chef] Re: Re: using chef resource in library


Chronological Thread 
  • From: Ameya Savale < >
  • To:
  • Subject: [chef] Re: Re: using chef resource in library
  • Date: Fri, 21 Feb 2014 10:05:51 -0800

thanks Noah


On Thu, Feb 20, 2014 at 6:36 PM, Noah Kantrowitz < " target="_blank"> > wrote:
Library code is just 100% plain ruby code, so you can't use the recipe dsl unless you do special stuff to set that up. If you are trying to write class based resources using the lwp dsl, check out Poise and some of the cookbooks using it.

--Noah

Ameya Savale < " target="_blank"> > wrote:
Hi Guys,

I was wondering if it was possible to use a chef resource such as 'file' or 'cookbook_file' in a custom library. I have tried the following and none of them have been successful:

class Chef
 class Recipe
  class myhelper
   
   file "..." do

   end 
 

class Chef
 class Resource
  class myhelper
   
   file "..." do

   end 

class Chef
 class Resource
  class myhelper < ::Chef::Resource
   
   file "..." do

   end 
 
-thanks




Archive powered by MHonArc 2.6.16.

§