Per environment run lists in ruby DSL:: wiki not matching functionality


#1

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!


#2

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” hikeit@gmail.com 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!


#3

Nevermind that, you already have it.
On Apr 9, 2012 11:08 AM, “James” js@aegisco.com 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” hikeit@gmail.com 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!


#4

Anyone else? Should I update the wiki to match what I am seeing happen?
(what i’m seeing is that i need to remove the run_list for a role and
replace it with an env_run_lists entry for _default)

On Mon, Apr 9, 2012 at 14:10, James js@aegisco.com wrote:

Nevermind that, you already have it.

On Apr 9, 2012 11:08 AM, “James” js@aegisco.com 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” hikeit@gmail.com 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!