Templates or file by role


#1

From http://wiki.opscode.com/display/chef/Templates and the pdfs available
from opscode I can tell that using the templates directory structure I can
use rules so that the client gets a different file or template depending on
its fqdn or platform/platform-version.

Are there any others? Specifically I’d like to do the same but with roles.
This way I can have separate files depending on environment: dev, staging,
production.

Or is there a better way to do this?

Tristan


#2

Have the template source file in an attribute defined in the role?

On Feb 14, 2011, at 7:55 AM, Tristan Sloughter wrote:

From http://wiki.opscode.com/display/chef/Templates and the pdfs available from opscode I can tell that using the templates directory structure I can use rules so that the client gets a different file or template depending on its fqdn or platform/platform-version.

Are there any others? Specifically I’d like to do the same but with roles. This way I can have separate files depending on environment: dev, staging, production.

Or is there a better way to do this?

Tristan


#3

I’m willing to admit I have a “case” that does it in at least one place.


#4

Yo,

On 15 February 2011 04:55, Tristan Sloughter
tristan.sloughter@gmail.com wrote:

From http://wiki.opscode.com/display/chef/Templates and the pdfs available
from opscode I can tell that using the templates directory structure I can
use rules so that the client gets a different file or template depending on
its fqdn or platform/platform-version.
Are there any others? Specifically I’d like to do the same but with roles.
This way I can have separate files depending on environment: dev, staging,
production.
Or is there a better way to do this?
Tristan

Not released yet:

http://wiki.opscode.com/display/chef/Environments#Environments-PerEnvironmentRunListsinRoles

Regards,

AJ