Confused about env_run_lists


#1

Ohai,

Reading up on environments and env_run_lists I feel like I’m missing
something.

If I need to specify a default recipe to run on e.g. the preprod env:

preprod.rb:
env_run_lists “preprod” => [“recipe[myrecipe]”],
"_default" => []

What happens if I also specify something (by mistake) in e.g. prod:
preprod.rb:
env_run_lists “preprod” => [“recipe[myotherrecipe]”],
"_default" => []

Basically I don’t understand why I need to specify the environment again
when I’m already in e.g. the preprod.rb env file?

In addition what will the recipe order be in the final run_list?

/Jeppe


#2

have you tested this? im not sure if this will work on environment
definitions. Definitely works for roles, and inside role definition.

On Jun 24, 2013 2:23 AM, “Jeppe Nejsum Madsen” jeppe@ingolfs.dk wrote:

Ohai,

Reading up on environments and env_run_lists I feel like I’m missing
something.

If I need to specify a default recipe to run on e.g. the preprod env:

preprod.rb:
env_run_lists “preprod” => [“recipe[myrecipe]”],
"_default" => []

What happens if I also specify something (by mistake) in e.g. prod:
preprod.rb:
env_run_lists “preprod” => [“recipe[myotherrecipe]”],
"_default" => []

Basically I don’t understand why I need to specify the environment again
when I’m already in e.g. the preprod.rb env file?

In addition what will the recipe order be in the final run_list?

/Jeppe


#3

On Monday, June 24, 2013 at 10:21 AM, Ranjib Dey wrote:

have you tested this? im not sure if this will work on environment definitions. Definitely works for roles, and inside role definition.

This is correct, env_run_lists go inside roles only.


Daniel DeLeo


#4

the doc needs to fixed ?
http://docs.opscode.com/essentials_environments.html#set-per-environment-run-lists

On Mon, Jun 24, 2013 at 10:23 AM, Daniel DeLeo dan@kallistec.com wrote:

On Monday, June 24, 2013 at 10:21 AM, Ranjib Dey wrote:

have you tested this? im not sure if this will work on environment
definitions. Definitely works for roles, and inside role definition.

This is correct, env_run_lists go inside roles only.


Daniel DeLeo


#5

On Mon, 24 Jun 2013 10:35:14 -0700
Ranjib Dey dey.ranjib@gmail.com wrote:

the doc needs to fixed ?
http://docs.opscode.com/essentials_environments.html#set-per-environment-run-lists

This json is a role example. NOT an environment example.
That is, “webserver” is a role.

You cannot specify env_run_list inside an environment because, of
course, it is an environment.

env_run_list is only for roles.


Xabier de Zuazo Oteiza
IT System Administrator - Onddo Labs S.L.
Camino del Bosque 13
t: (+34) 946.569.935
www.onddo.com

Public Key = http://www.onddo.com/xabier_zuazo.pub
Key Fingerprint = 8EFA 5B17 7275 5F1F 42B2 26B4 8E18 8B67 9DE1 9468


#6

On Mon, Jun 24, 2013 at 7:52 PM, Xabier de Zuazo xabier@zuazo.org wrote:

On Mon, 24 Jun 2013 10:35:14 -0700
Ranjib Dey dey.ranjib@gmail.com wrote:

the doc needs to fixed ?

http://docs.opscode.com/essentials_environments.html#set-per-environment-run-lists

This json is a role example. NOT an environment example.
That is, “webserver” is a role.

You cannot specify env_run_list inside an environment because, of
course, it is an environment.

env_run_list is only for roles.

That makes sense, but the docs clearly needs an overhaul. While the JSON
example shows a role if you look closely, what has that got to with
environments?

Also note the section “Domain-specific Ruby attributes for environments
include the following:” and goes on to list env_run_list.

But at least I’m no longer confused (about this particular thing at least
:-), so thanks all for clearing this up…

/Jeppe


#7

On Mon, 24 Jun 2013 23:04:22 +0200
Jeppe Nejsum Madsen jeppe@ingolfs.dk wrote:

the doc needs to fixed ?

http://docs.opscode.com/essentials_environments.html#set-per-environment-run-lists

This json is a role example. NOT an environment example.
That is, “webserver” is a role.

You cannot specify env_run_list inside an environment because, of
course, it is an environment.

env_run_list is only for roles.

That makes sense, but the docs clearly needs an overhaul. While the
JSON example shows a role if you look closely, what has that got to
with environments?

Yes, maybe you are right. A role example in the environments section
can be a bit confusing. Perhaps it would be more appropriate to move
this example to the roles section.

Also note the section “Domain-specific Ruby attributes for
environments include the following:” and goes on to list env_run_list.

Looks like a mistake in the docs. AFAIK, this attribute should not be
in that section. It will not work. I will try to make a PR to fix it.


Xabier de Zuazo Oteiza
IT System Administrator - Onddo Labs S.L.
Camino del Bosque 13
t: (+34) 946.569.935
www.onddo.com

Public Key = http://www.onddo.com/xabier_zuazo.pub
Key Fingerprint = 8EFA 5B17 7275 5F1F 42B2 26B4 8E18 8B67 9DE1 9468


#8

Hi All!

Related to this thread, on the "Essentials
Roleshttp://docs.opscode.com/essentials_roles.html"
wiki page, there is an open issue since 22SEP2011 (
CHEF-2636http://tickets.opscode.com/browse/CHEF-2636 )
concerning the wording of the env_run_list section:

The section states clearly that you NEED a “_default” configuration:

Optional. A list of environments, each specifying a recipe or a role that
will be applied to that environment. This setting must specify the _default
environment. If the _default environment is set to [] or nil, then the run
list will be empty. jamescott: SEE CHEF-2636.

But in all-but-one subsequent examples, there is no “_default”:

env_run_lists “prod” => [“recipe[apache2]”],

          "staging" => ["recipe[apache2::staging]"

and later in the page:

env_run_lists “name” => [“recipe[name]”], “environment_name” =>
[“recipe[name::attribute]”]

and:

“env_run_lists” : {

"production" : [],
"preprod" : [],
"dev": [
  "role[base]",
  "recipe[apache]",
  "recipe[apache::copy_dev_configs]",
],

-Mike

On Tue, Jun 25, 2013 at 12:42 AM, Xabier de Zuazo xabier@onddo.com wrote:

On Mon, 24 Jun 2013 23:04:22 +0200
Jeppe Nejsum Madsen jeppe@ingolfs.dk wrote:

the doc needs to fixed ?

http://docs.opscode.com/essentials_environments.html#set-per-environment-run-lists

This json is a role example. NOT an environment example.
That is, “webserver” is a role.

You cannot specify env_run_list inside an environment because, of
course, it is an environment.

env_run_list is only for roles.

That makes sense, but the docs clearly needs an overhaul. While the
JSON example shows a role if you look closely, what has that got to
with environments?

Yes, maybe you are right. A role example in the environments section
can be a bit confusing. Perhaps it would be more appropriate to move
this example to the roles section.

Also note the section “Domain-specific Ruby attributes for
environments include the following:” and goes on to list env_run_list.

Looks like a mistake in the docs. AFAIK, this attribute should not be
in that section. It will not work. I will try to make a PR to fix it.


Xabier de Zuazo Oteiza
IT System Administrator - Onddo Labs S.L.
Camino del Bosque 13
t: (+34) 946.569.935
www.onddo.com

Public Key = http://www.onddo.com/xabier_zuazo.pub
Key Fingerprint = 8EFA 5B17 7275 5F1F 42B2 26B4 8E18 8B67 9DE1 9468

This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are
addressed. Please note that any disclosure, copying or distribution of the
content of this information is strictly forbidden. If you have received
this email message in error, please destroy it immediately and notify its
sender.
**


#9

On Tue, 25 Jun 2013 10:23:08 +0300
Mike Tewner mike@scene53.com wrote:

Related to this thread, on the "Essentials
Roleshttp://docs.opscode.com/essentials_roles.html"
wiki page, there is an open issue since 22SEP2011 (
CHEF-2636http://tickets.opscode.com/browse/CHEF-2636 )
concerning the wording of the env_run_list section:

The section states clearly that you NEED a “_default” configuration:

Optional. A list of environments, each specifying a recipe or a
role that will be applied to that environment. This setting must
specify the _default environment. If the _default environment is
set to [] or nil, then the run list will be empty. jamescott: SEE
CHEF-2636.

But in all-but-one subsequent examples, there is no “_default”:

env_run_lists “prod” => [“recipe[apache2]”],

          "staging" => ["recipe[apache2::staging]"

and later in the page:

env_run_lists “name” => [“recipe[name]”], “environment_name” =>
[“recipe[name::attribute]”]

and:

“env_run_lists” : {

"production" : [],
"preprod" : [],
"dev": [
  "role[base]",
  "recipe[apache]",
  "recipe[apache::copy_dev_configs]",
],

These examples do not need the “_default” because they use
the “run_list” attribute to set the default run list. Something like
this:

“env_run_lists”: {
“production”: [],
“preprod”: [],
[…]
},
“run_list”: [ “role[base]”, “recipe[apache]” ],

So you do not need to create a “_default” key there. This is equivalent
to:

“env_run_lists”: {
“default”: [ “role[base]”, “recipe[apache]” ],
“production”: [],
“preprod”: [],
[…]
},

I know this can be confusing.

IMHO we should clarify this in the “env_run_lists” and "run_lists"
sections.


Xabier de Zuazo Oteiza
IT System Administrator - Onddo Labs S.L.
www.onddo.com

Public Key = http://www.onddo.com/xabier_zuazo.pub
Key Fingerprint = 8EFA 5B17 7275 5F1F 42B2 26B4 8E18 8B67 9DE1 9468