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


Chronological Thread 
  • From: Ranjib Dey < >
  • To: " " < >
  • Subject: [chef] Re: Attribute to be ":kind of" another resource ?
  • Date: Tue, 17 Feb 2015 11:21:52 -0800

you can. you can also get a resource identifier as string like "template[/foo/bar]", and construct the resource back in your provider, chef has helper for all this. but in chef resources are generally decoupled,  and communication are done as notifications. this also decouples what & when to do when a notification is receive. you'll complicate all those things, as the order of the consumed resource etc will matter.

why not hide the other resource as a sub resource ? i.e. construct BinaryServer inside AdminServer, then AdminServer can expose a binary_server attribute to customize the underlying BinaryServer , but its opaque to the consumer.

regards
ranjib

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.

§