[chef] Roles fail to load in chef-solo run_list


Chronological Thread 
  • From: Tom < >
  • To:
  • Subject: [chef] Roles fail to load in chef-solo run_list
  • Date: Tue, 25 Sep 2012 14:23:44 +0100

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

roles:
---
 {
  "name": "yum-server",
  "chef_type": "role",
 
  "default_attributes": {
    "apache2": {
      "listen_ports": ["80", "443"],
      "default_site_enabled": false
    }
  },
  "run_list": [ "recipe[apache2]",
                "recipe[apache2::mod_ssl]",
                "recipe[apache2::yum-website]",
                "role[minidnsmaster]"
              ]
}
---
{
  "name": "minidnsmaster",
  "chef_type": "role",
 
  "default_attributes": {
    "bind": {
      "slaves": [ "10.39.102.20", "10.31.157.234" ]
    }
  },
 
  "run_list": [ "recipe[build-essential]",
                "recipe[sudo::bind]",
                "recipe[bind]",
                "recipe[bind::master]",
                "recipe[yum-server]",
                "recipe[yum-server::repos]",
                "recipe[yum-server::build_alfresco]",
                "recipe[yum-server::build_cloudportal]"
    ]
}
---
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 #<Hash:0x0000000287f4e0>

[2012-09-25T14:17:23+01:00] FATAL: Stacktrace dumped to /var/cache/chef-solo/chef-stacktrace.out
[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?

Thanks

Tom



Archive powered by MHonArc 2.6.16.

§