# Attribute ordering in nested Roles

**URL:** <https://discourse.chef.io/t/attribute-ordering-in-nested-roles/1571>\
**Category:** Chef Infra (archive)\
**Created:** [October 5, 2010, 11:00am UTC](https://discourse.chef.io/t/attribute-ordering-in-nested-roles/1571 "2010-10-05T11:00:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Matthews](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@Jonathan\_Matthews](https://discourse.chef.io/u/Jonathan_Matthews)\
**Post date:** [October 5, 2010, 11:00am UTC](https://discourse.chef.io/t/attribute-ordering-in-nested-roles/1571/1 "2010-10-05T11:00:20Z")

</div>

Hey all -

Is it intended (chef-client & -server 0.9.8 via RPMs) for a Role’s  
defaults and overrides to be applied /before/ those of any Roles that  
it itself includes in its run\_list?

I’m seeing this behaviour whilst trying to dictate which httpd MPM I’d  
like used. To my mind, it makes sense for a an (arbitrary) "App\_XYZ"  
Role to include an “httpd\_server” Role (rather than merely apply them  
in order, directly on the Node I’m interested in), but it requires  
MPM:prefork. The fact that App\_XYZ’s Attributes seem to be applied  
before httpd\_server’s means I can’t pull in everything that  
httpd\_server provides and then selectively override the MPM setting  
from httpd\_server’s default of MPM:worker.

Would it not be more sensible for the _including_ Role’s defaults to  
be applied first, then the defaults/overrides from the Roles it  
includes, and finally the overrides from the including Role?

If I’ve missed something fundamental or a previous flamefest on this  
issue, please do point me towards it and - if possible - an  
explanation of how I should better achieve what I’ve described!

## Cheers, Jonathan

Jonathan Matthews  
London, UK  
[http://www.jpluscplusm.com/contact.html](http://www.jpluscplusm.com/contact.html)

---

<div class="post-metadata">

**Author:** ![benton](https://avatars.discourse-cdn.com/v4/letter/b/a88e57/32.png) [@benton](https://discourse.chef.io/u/benton)\
**Post date:** [October 5, 2010, 11:37am UTC](https://discourse.chef.io/t/attribute-ordering-in-nested-roles/1571/2 "2010-10-05T11:37:16Z")

</div>

Hello, Jonathan.

On Oct 5, 2010, at 7:00 AM, Jonathan Matthews wrote:

> Is it intended (chef-client & -server 0.9.8 via RPMs) for a Role's  
> defaults and overrides to be applied /before/ those of any Roles that  
> it itself includes in its run\_list?

I have the same problem. I posted to this mailing list about it in June:  
[chef - [chef] Attribute value precedence order in nested roles](http://lists.opscode.com/sympa/arc/chef/2010-06/msg00013.html)  
I filed a bug as well, though I don't have the link handy. There were no replies to the email, and no response to the bug report. ☹

- R. Newbie

---

<div class="post-metadata">

**Author:** ![Jonathan\_Matthews](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@Jonathan\_Matthews](https://discourse.chef.io/u/Jonathan_Matthews)\
**Post date:** [October 5, 2010, 12:56pm UTC](https://discourse.chef.io/t/attribute-ordering-in-nested-roles/1571/3 "2010-10-05T12:56:40Z")

</div>

On 5 October 2010 12:37, Ruby Newbie [rubynewbie@me.com](mailto:rubynewbie@me.com) wrote:

> On Oct 5, 2010, at 7:00 AM, Jonathan Matthews wrote:
> 
> > Is it intended (chef-client & -server 0.9.8 via RPMs) for a Role's  
> > defaults and overrides to be applied /before/ those of any Roles that  
> > it itself includes in its run\_list?
> 
> I have the same problem. I posted to this mailing list about it in June:  
> [http://lists.opscode.com/sympa/arc/chef/2010-06/msg00013.html](http://lists.opscode.com/sympa/arc/chef/2010-06/msg00013.html)  
> I filed a bug as well, though I don't have the link handy. There were no replies to the email, and no response to the bug report. ☹

Thanks for that - appreciated. I can see from your bug  
([http://tickets.opscode.com/browse/CHEF-1354](http://tickets.opscode.com/browse/CHEF-1354)) that there's a solution  
proposed in a duplicate bug  
([http://tickets.opscode.com/browse/CHEF-1508](http://tickets.opscode.com/browse/CHEF-1508)) but there's no  
indication of if this is being actively pursued for 0.10. Could  
anyone Opscode-ish comment?

## Regards, Jonathan

Jonathan Matthews  
London, UK

> **[Jonathan Matthews :: Words Typed, Great Rates For Cash](https://www.jpluscplusm.com)**

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [October 5, 2010, 3:32pm UTC](https://discourse.chef.io/t/attribute-ordering-in-nested-roles/1571/4 "2010-10-05T15:32:28Z")

</div>

On Tue, Oct 5, 2010 at 5:56 AM, Jonathan Matthews  
[contact@jpluscplusm.com](mailto:contact@jpluscplusm.com) wrote:

> On 5 October 2010 12:37, Ruby Newbie [rubynewbie@me.com](mailto:rubynewbie@me.com) wrote:
> 
> > On Oct 5, 2010, at 7:00 AM, Jonathan Matthews wrote:
> 
> Thanks for that - appreciated. I can see from your bug  
> ([http://tickets.opscode.com/browse/CHEF-1354](http://tickets.opscode.com/browse/CHEF-1354)) that there's a solution  
> proposed in a duplicate bug  
> ([http://tickets.opscode.com/browse/CHEF-1508](http://tickets.opscode.com/browse/CHEF-1508)) but there's no  
> indication of if this is being actively pursued for 0.10. Could  
> anyone Opscode-ish comment?

Maybe I was too brief in my comment on CHEF-1508, but the situation is  
that this change could potentially break people's roles if they're  
relying on the current behavior (intentionally or otherwise) so it  
can't be changed until a major version bump, which means Chef 0.10.0.  
We are still actively working on the major features that will be part  
of the 0.10 release, so that's why you don't see any activity on the  
ticket--I haven't forgotten it, we just can't merge it until we're  
ready to branch the code base for 0.10.

> ## Regards, Jonathan
> 
> Jonathan Matthews  
> London, UK  
> [http://www.jpluscplusm.com/contact.html](http://www.jpluscplusm.com/contact.html)

Dan DeLeo

---

<div class="post-metadata">

**Author:** ![Jonathan\_Matthews](https://avatars.discourse-cdn.com/v4/letter/j/fbc32d/32.png) [@Jonathan\_Matthews](https://discourse.chef.io/u/Jonathan_Matthews)\
**Post date:** [October 5, 2010, 10:36pm UTC](https://discourse.chef.io/t/attribute-ordering-in-nested-roles/1571/5 "2010-10-05T22:36:33Z")

</div>

On 5 October 2010 16:32, Daniel DeLeo [dan@kallistec.com](mailto:dan@kallistec.com) wrote

> We are still actively working on the major features that will be part  
> of the 0.10 release, so that's why you don't see any activity on the  
> ticket--I haven't forgotten it, we just can't merge it until we're  
> ready to branch the code base for 0.10.

Thanks for this, Dan.  
FMI, is this fix definitely slated to hit 0.10.0, or might it be  
0.10.x or even 0.11+?

## Jonathan

Jonathan Matthews  
London, UK

> **[Jonathan Matthews :: Words Typed, Great Rates For Cash](https://www.jpluscplusm.com)**
