Re: Re: Roles fail to load in chef-solo run_list



I don’t know if you ever solved this, but I ran across the same thing and
opened a bug about it.

TL;DR; – if your roles file doesn’t have the right json_class attribute
then I believe Chef tries to interpret it as a regular Hash and explodes.

  • Julian

On Tue, Sep 25, 2012 at 9:49 AM, Tom wrote:

I only include one role in the other. I don’t see how that makes an
infinite/dead loop. I don’t include each role in each other.

Take the roles out of the run list so they are only recipes. Everything
runs ok. Include one role in the other and run one role, I get the hash

It seems more like chef cannot handle loading a sub-role.

On 25 September 2012 14:29, William Herry WilliamHerryChina@gmail.comwrote:

seem like a dead loop, role[minidnsmaster] included a role[yum-server]
which included role[minidnsmaster] again

On Tue, Sep 25, 2012 at 9:23 PM, Tom wrote:

I’m trying to add an existing role to the run list of another role using
Both roles run independently alone, but when I add one role to the
run_list of the other I receive a Hash error.


“name”: “yum-server”,
“chef_type”: “role”,

“default_attributes”: {
“apache2”: {
“listen_ports”: [“80”, “443”],
“default_site_enabled”: false
“run_list”: [ “recipe[apache2]”,

“name”: “minidnsmaster”,
“chef_type”: “role”,

“default_attributes”: {
“bind”: {
“slaves”: [ “”, “” ]

“run_list”: [ “recipe[build-essential]”,

role[yum-server] fails to run as it is calling role[minidnsmaster] with
this error:

2012-09-25T14:17:22+01:00] INFO: *** Chef 10.14.2 ***
[2012-09-25T14:17:23+01:00] INFO: Setting the run_list to
[“recipe[apache2]”, “recipe[apache2::mod_ssl]”,
“recipe[apache2::yum-website]”, “role[minidnsmaster]”] from JSON

Error expanding the run_list:


Unexpected Error:

NoMethodError: undefined method `run_list_for’ for

[2012-09-25T14:17:23+01:00] FATAL: Stacktrace dumped to
[2012-09-25T14:17:23+01:00] FATAL: NoMethodError: undefined method
`run_list_for’ for #Hash:0x0000000287f4e0

I can see somewhere combining the JSON hashes is failing.

Any ideas?



[ Julian C. Dunn * Sorry, I’m ]
[ WWW: * only Web 1.0 ]
[ gopher:// * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]