I’m trying to come up with an efficient way to promote changes to our
applications one environment at a time. Say I have 4 prod environments, and
many roles in each environment, some for database, some for app server,
etc. My task is to promote a new version of database to each environment in
a specific role only, one environment at a time (to avoid downtime).
If I update the database version attribute in the role, it’ll update all
environments. If I update the database version attribute in the
environment, it’ll update all databases in that environment, not only the
one I’m targeting.
I want to have ability to specify something like the following in the role:
My current solution is to use env_run_lists() to do this, but it’s
time-consuming as I have to create a new recipe each time I want to upgrade
to new version.
Does that make sense? Would anyone know how I can go about implementing
this role functionality?
My current solution is to use env_run_lists() to do this, but it's
time-consuming as I have to create a new recipe each time I want to
upgrade to new version.
Does that make sense? Would anyone know how I can go about
implementing this role functionality?
I recommend you read the comments below. It seems that it would not be
advisable to use this feature in case of adding it to the core.
I started the implementation of this some time ago. It's actually quite
simple. But I didn't continue with it because it seemed that there was
no interest.
Regards,
--
Xabier de Zuazo Oteiza
IT System Administrator - Onddo Labs S.L. www.onddo.com
My current solution is to use env_run_lists() to do this, but it's
time-consuming as I have to create a new recipe each time I want to
upgrade to new version.
Does that make sense? Would anyone know how I can go about
implementing this role functionality?
I recommend you read the comments below. It seems that it would not be
advisable to use this feature in case of adding it to the core.
I started the implementation of this some time ago. It's actually quite
simple. But I didn't continue with it because it seemed that there was
no interest.
Regards,
--
Xabier de Zuazo Oteiza
IT System Administrator - Onddo Labs S.L. www.onddo.com
That doesn't make sense... There's a well-defined need for having
role+environment specific attributes. Most organizations have multiple prod
environments and want to roll out upgrades one environment at a time.
I think the method of having a switch/if statement in recipe or using
environment run lists is too burdensome... Plus I want my users to stop
writing one-off recipes. Having env attributes would make it super easy to
get the big picture by looking at just one role.
Xabier, if you have any code from your attempt you can share or point me to
the right direction, I'd like to give it a try!
My current solution is to use env_run_lists() to do this, but it's
time-consuming as I have to create a new recipe each time I want to
upgrade to new version.
Does that make sense? Would anyone know how I can go about
implementing this role functionality?
I recommend you read the comments below. It seems that it would not be
advisable to use this feature in case of adding it to the core.
I started the implementation of this some time ago. It's actually quite
simple. But I didn't continue with it because it seemed that there was
no interest.
Regards,
--
Xabier de Zuazo Oteiza
IT System Administrator - Onddo Labs S.L. www.onddo.com
Well, like you said, env run lists are a bit of a burden, and with people
writing more application cookbooks than roles, it's easier to put the logic
into a recipe (and is currently a best practice since roles aren't
versionable).
Until roles are versionable, which was loudly voted for at the Chef 12
discussion, I doubt you'll see any official traction on this front.
Currently less is more when it comes to roles.
--
~~ StormeRider ~~
"Every world needs its heroes [...] They inspire us to be better than we
are. And they protect from the darkness that's just around the corner."
That doesn't make sense... There's a well-defined need for having
role+environment specific attributes. Most organizations have multiple prod
environments and want to roll out upgrades one environment at a time.
I think the method of having a switch/if statement in recipe or using
environment run lists is too burdensome... Plus I want my users to stop
writing one-off recipes. Having env attributes would make it super easy to
get the big picture by looking at just one role.
Xabier, if you have any code from your attempt you can share or point me
to the right direction, I'd like to give it a try!
My current solution is to use env_run_lists() to do this, but it's
time-consuming as I have to create a new recipe each time I want to
upgrade to new version.
Does that make sense? Would anyone know how I can go about
implementing this role functionality?
I recommend you read the comments below. It seems that it would not be
advisable to use this feature in case of adding it to the core.
I started the implementation of this some time ago. It's actually quite
simple. But I didn't continue with it because it seemed that there was
no interest.
Regards,
--
Xabier de Zuazo Oteiza
IT System Administrator - Onddo Labs S.L. www.onddo.com
Xabier, if you have any code from your attempt you can share or point
me to the right direction, I'd like to give it a try!
I honestly don't remember how far I get. I rebased this against the
las Chef 10 stable, but this code is more than a year old and is
not tested, it may even be incomplete. Used the wrong way can destroy
the space time continuum.
If you want to test this with Chef 11, you will also need to patch
erchef:
[...]
Regards,
--
Xabier de Zuazo Oteiza
IT System Administrator - Onddo Labs S.L. www.onddo.com
Thanks Xabier! Unfortunately I don't know much about Chef to be able to
patch it.. If I end up implementing this sort of feature, I'll go the route
of writing a special recipe that looks at a special place containing
environments and attributes. Then it overrides attributes with the ones it
found, if applicable. Finally, I'll place that special recipe first thing
in the runlist.
On Fri, Nov 15, 2013 at 10:30 AM, Xabier de Zuazo xabier@onddo.com wrote:
I honestly don't remember how far I get. I rebased this against the
las Chef 10 stable, but this code is more than a year old and is
not tested, it may even be incomplete. Used the wrong way can destroy
the space time continuum.
If you want to test this with Chef 11, you will also need to patch
erchef: