Roles


#1

I’m working on a project for automating ec2 using chef solo, and have a
basic role system of our own in place. I’m trying to figure out if the
ability to attach a json ball to each role is going to cause problems.
Right now you can attach json to each role, and I merge all json balls for
each role into one json ball to hand off to chef solo. The danger is that
different roles will have duplicate json entries with different values, and
when stuff is merged things start to break. It’s also going to depend a lot
on how people use the json. Putting more in attribute files and less in the
json will help.

So right now we are are attaching json to each role, and at run time doing a
shallow merge. I’m thinking that maybe generating warnings in the ui when
there are conflicting keys might help. I really like being able to define
everything in roles instead of per server, but eventually we need a better
strategy for how to handle role specific data.

Any thoughts appreciated.

Chris


#2

This is quick, cause I’m on a plane. The role support that’s about to
ship does a merge for both default and override attributes. If there
is a conflict, the last role in the run-list wins.

It would be great if you could check out what we are about to ship, so
we can make sure it works for you. Should have dogs and stable tree
Monday in head.

Sent from my iPhone

On May 31, 2009, at 2:54 PM, snacktime snacktime@gmail.com wrote:

I’m working on a project for automating ec2 using chef solo, and
have a basic role system of our own in place. I’m trying to figure
out if the ability to attach a json ball to each role is going to
cause problems. Right now you can attach json to each role, and I
merge all json balls for each role into one json ball to hand off to
chef solo. The danger is that different roles will have duplicate
json entries with different values, and when stuff is merged things
start to break. It’s also going to depend a lot on how people use
the json. Putting more in attribute files and less in the json will
help.

So right now we are are attaching json to each role, and at run time
doing a shallow merge. I’m thinking that maybe generating warnings
in the ui when there are conflicting keys might help. I really like
being able to define everything in roles instead of per server, but
eventually we need a better strategy for how to handle role specific
data.

Any thoughts appreciated.

Chris