# Version locking and roles

**URL:** <https://discourse.chef.io/t/version-locking-and-roles/1986>\
**Category:** Chef Infra (archive)\
**Created:** [August 18, 2011, 7:20pm UTC](https://discourse.chef.io/t/version-locking-and-roles/1986 "2011-08-18T19:20:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![KC\_Braunschweig](https://avatars.discourse-cdn.com/v4/letter/k/ea5d25/32.png) [@KC\_Braunschweig](https://discourse.chef.io/u/KC_Braunschweig)\
**Post date:** [August 18, 2011, 7:20pm UTC](https://discourse.chef.io/t/version-locking-and-roles/1986/1 "2011-08-18T19:20:48Z")

</div>

So it sounds like a lot of people are protecting prod stability by  
specifying cookbook versions in their prod environments but not in the  
envs for pre-prod. How are you handling the fact that roles aren’t  
versioned though? I guess you can specify versions for the cookbooks  
of the recipes inside an assigned role individually, but what if the  
recipes in a role change? For instance, I want to introduce a new  
recipe into my base role, but I want to do it in pre-prod before  
production of course. If I add it into the base role, production  
version specs won’t stop it. What I want is to lock prod onto the  
version of the ROLE that doesn’t yet have the new recipe. I guess I  
could make version 0.0.1 of the new cookbook a no-op and add then make  
my real version 0.0.2 and lock prod to a no-op… and trust that it  
really is a no-op, kinda weak.

Anyone done a longer term writeup on what it’s like living with an  
evolving chef repo in pre-prod and prod over the longer term?

KC

---

<div class="post-metadata">

**Author:** ![Joshua\_Timberman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/joshua_timberman/32/424_2.png) [@Joshua\_Timberman](https://discourse.chef.io/u/Joshua_Timberman)\
**Post date:** [August 18, 2011, 9:34pm UTC](https://discourse.chef.io/t/version-locking-and-roles/1986/2 "2011-08-18T21:34:31Z")

</div>

Hello!

On Thu, Aug 18, 2011 at 1:20 PM, KC Braunschweig  
[kcbraunschweig@gmail.com](mailto:kcbraunschweig@gmail.com) wrote:

> Anyone done a longer term writeup on what it's like living with an  
> evolving chef repo in pre-prod and prod over the longer term?

You can use environment-specific run lists in Roles.

[http://wiki.opscode.com/display/chef/Roles#Roles-envrunlists](http://wiki.opscode.com/display/chef/Roles#Roles-envrunlists)

--  
Opscode, Inc  
Joshua Timberman, Director of Training and Services  
IRC, Skype, Twitter, Github: jtimberman

---

<div class="post-metadata">

**Author:** ![Jesse\_Nelson](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jesse_nelson/32/262_2.png) [@Jesse\_Nelson](https://discourse.chef.io/u/Jesse_Nelson)\
**Post date:** [August 18, 2011, 9:40pm UTC](https://discourse.chef.io/t/version-locking-and-roles/1986/3 "2011-08-18T21:40:16Z")

</div>

Works great unless you need to change the attribs or overrides in the  
role as well.

On Thu, Aug 18, 2011 at 2:34 PM, Joshua Timberman [joshua@opscode.com](mailto:joshua@opscode.com) wrote:

> Hello!
> 
> On Thu, Aug 18, 2011 at 1:20 PM, KC Braunschweig  
> [kcbraunschweig@gmail.com](mailto:kcbraunschweig@gmail.com) wrote:
> 
> > Anyone done a longer term writeup on what it's like living with an  
> > evolving chef repo in pre-prod and prod over the longer term?
> 
> You can use environment-specific run lists in Roles.
> 
> [http://wiki.opscode.com/display/chef/Roles#Roles-envrunlists](http://wiki.opscode.com/display/chef/Roles#Roles-envrunlists)
> 
> --  
> Opscode, Inc  
> Joshua Timberman, Director of Training and Services  
> IRC, Skype, Twitter, Github: jtimberman

---

<div class="post-metadata">

**Author:** ![Joshua\_Timberman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/joshua_timberman/32/424_2.png) [@Joshua\_Timberman](https://discourse.chef.io/u/Joshua_Timberman)\
**Post date:** [August 18, 2011, 9:44pm UTC](https://discourse.chef.io/t/version-locking-and-roles/1986/4 "2011-08-18T21:44:52Z")

</div>

On Thu, Aug 18, 2011 at 3:40 PM, Jesse Nelson [spheromak@gmail.com](mailto:spheromak@gmail.com) wrote:

> Works great unless you need to change the attribs or overrides in the  
> role as well.

Sure, though for that you can set environment specific attributes in  
the environment itself.

[http://wiki.opscode.com/display/chef/environments#Environments-attributes](http://wiki.opscode.com/display/chef/environments#Environments-attributes)
