[chef] Re: Attribute to be ":kind of" another resource ?


Chronological Thread 
  • From: Nathan Williams < >
  • To:
  • Subject: [chef] Re: Attribute to be ":kind of" another resource ?
  • Date: Tue, 17 Feb 2015 11:22:19 -0800

you can do this pretty easily, i think kind_of just takes a class name as an argument, so you could just say `:kind_of => Chef::Resource::BinaryServer`. I do something very similar in the haproxy-ng cookbook, but via callbacks, as the attribute takes multiples:

https://github.com/nathwill/chef-haproxy-ng/blob/master/libraries/00_haproxy_instance.rb#L66-L69

Regards,

Nathan Williams

On Tue, Feb 17, 2015 at 9:46 AM, Medya < " target="_blank"> > wrote:
Can I have an attribute that is kind of another resource ?

here is my scenario,

I have a resource called BinaryServer and let say it has attributes like (name, installation_dir, version )

I have another resource called AdminServer 

in AdminServes provider I wanna access the Binary Server's attribute.

I was wondering if I could have an attribute type of BinaryServer,
so I could do this,
new_resource.binary_server.installation_dir


ideas?




Archive powered by MHonArc 2.6.16.

§