[chef] Re: Re: have different required attributes fro different actions on a resource


Chronological Thread 
  • From: AJ Christensen < >
  • To: " " < >
  • Cc: Medya < >
  • Subject: [chef] Re: Re: have different required attributes fro different actions on a resource
  • Date: Tue, 17 Feb 2015 08:58:59 +1300

I'd consider whyrun assertions for this too ;)

--aj

On Tue, Feb 17, 2015 at 8:46 AM, Lamont Granquist 
< >
 wrote:
> On 2/16/15 11:13 AM, Medya wrote:
>>
>> how can I make it a resource, so that :
>>
>>     if the action is install, the install_dir attribute be required,
>>
>>     and if the action is patch, the patch_id attribute be required ?
>>
> Probably in the after_created hook in the resource:
>
> https://github.com/chef/chef/blob/master/lib/chef/resource/remote_file.rb#L128-L130
>



Archive powered by MHonArc 2.6.16.

§