[chef] To use attributes or resource properties to coordinate between resources?


Chronological Thread 
  • From: Peter Donald < >
  • To:
  • Subject: [chef] To use attributes or resource properties to coordinate between resources?
  • Date: Fri, 25 Nov 2011 13:17:50 +1100

Hi,

So we are just starting out using Chef and come across a scenario
where we are needing to configure one resource based on the parameters
of another resource. So we have defined a "glassfish_domain"
resource/provider combo. One of the properties is that port on which
it can be administered. Among other things you need this port to
administer the server so when we are connecting to the admin console
from another provider (i.e. to deploy an application) we are doing
something like;

# new_resource.domain_name is the name of the domain we want to deploy to
port = new_resource.resources(:glassfish_domain =>
new_resource.domain_name).admin_port

Is accessing properties on other resources the "right" way of doing
things or should we we set attributes in the recipe that creates the
domain? As some of these values are synthesized during the creation of
the domain it is not going to be something we can access from a data
bag or the like.

-- 
Cheers,

Peter Donald



Archive powered by MHonArc 2.6.16.

§