fuzzygroup
fuzzygroup

Reputation: 1149

Is there a Chef equivalent of a Rails constants file?

We're using chef to deploy a multi-server, multi-application Ruby on Rails application to a cluster of boxes. Each git repo is defined as an individual unix user to prevent gem clashes, provide process isolation, etc. What we're finding is that we keep having to define each repo on each box and we're wondering is there a way to to define an array (really just an array of strings) in one place that we can then use everywhere we need to iterate and do things like setup rvm, install vim configuration, etc.

Its not a node. Its not a role. Its something constant across all machines regardless of their node or their role.

Upvotes: 1

Views: 230

Answers (1)

user2647274
user2647274

Reputation:

Data bags are often used for storing data that doesn't have a 1-to-1 correspondence with nodes. You could create a simple 'repos' data bag that contains the list of every repo you want to configure, and could then access that from any recipe. See the data bag docs for more info.

Upvotes: 4

Related Questions