[chef] Re: per environment run lists in ruby DSL:: wiki not matching functionality


Chronological Thread 
  • From: James < >
  • To:
  • Subject: [chef] Re: per environment run lists in ruby DSL:: wiki not matching functionality
  • Date: Mon, 9 Apr 2012 11:10:53 -0700

Nevermind that, you already have it.

On Apr 9, 2012 11:08 AM, "James" < "> > wrote:

Maybe add a blank _default environment to your list. This is the base environment and there is probably an assumption that it will be included.

On Apr 9, 2012 7:20 AM, "Jesse Campbell" < " target="_blank"> > wrote:
From the wiki (here: http://wiki.opscode.com/display/chef/Roles) I am
told to do this to get a per-environment run list from a ruby dsl
file:

name "webserver"
description "The base role for systems that serve HTTP traffic"
run_list "recipe[apache2]", "recipe[apache2::mod_ssl]", "role[monitor]"
env_run_lists "prod" => ["recipe[apache2]"], "staging" =>
["recipe[apache2::staging]"]
default_attributes "apache2" => { "listen_ports" => [ "80", "443" ] }
override_attributes "apache2" => { "max_children" => "50" }

When I try to do that, i get an error upon uploading the role:

ERROR: Chef::Exceptions::InvalidEnvironmentRunListSpecification:
_default key is required in env_run_lists.

I have to change it to this to get it to work:

name "webserver"
description "The base role for systems that serve HTTP traffic"
env_run_lists "prod" => ["recipe[apache2]"], "staging" =>
["recipe[apache2::staging]"], "_default" => ["recipe[apache2]",
"recipe[apache2::mod_ssl]", "role[monitor]"]
default_attributes "apache2" => { "listen_ports" => [ "80", "443" ] }
override_attributes "apache2" => { "max_children" => "50" }

Is the documentation wrong, or is this a bug? Should I have to move
the run_list specification into an _default key of env_run_lists?
I am running chef server 0.10.6 on centos with a mac knife client,
where knife is version 0.10.8... is this an error in going between
0.10.8 knife and 0.10.6 server?

Thanks all,
-Jesse
PS: Opscode: love the stickers!



Archive powered by MHonArc 2.6.16.

§