[chef] Re: Re: Re: env_run_list vs run_list


Chronological Thread 
  • From: Sachin Sagar Rai < >
  • To:
  • Subject: [chef] Re: Re: Re: env_run_list vs run_list
  • Date: Tue, 24 Apr 2012 20:25:33 +0545

@Jay, Thanks.
I'm so stupid.

-------------------------------------------
@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow

On Tuesday, April 24, 2012 at 1:04 AM, Jay Feldblum wrote:

Because it's just Ruby:

name "base"
description "Base role applied to all nodes."

all = [
    "recipe[apt]",
    "recipe[build-essential]",
    "recipe[git]",
    "recipe[zsh]",
    "recipe[users::sysadmins]",
    "recipe[sudo]",
]

run_list(all)

env_run_lists(
    "production" => all + ["recipe[chef-client]"],
    "staging" => all,
)

Cheers,
Jay

On Mon, Apr 23, 2012 at 2:36 PM, Noah Kantrowitz < " target="_blank"> > wrote:

On Apr 20, 2012, at 12:57 PM, Sachin Sagar Rai wrote:

> I'm confused regarding the `env_run_lists` in the following `roles/base.rb`. And this didn't http://wiki.opscode.com/display/chef/Roles#Roles-envrunlists make me clear enough.
>
>     name "base"
>     description "Base role applied to all nodes."
>     run_list(
>       "recipe[apt]",
>       "recipe[build-essential]",
>       "recipe[git]",
>       "recipe[zsh]",
>       "recipe[users::sysadmins]",
>       "recipe[sudo]",
>     )
>
>     env_run_lists(
>       "production" => ["recipe[chef-client]"],
>       "staging" => [])
>     )
>
> When I run the `knife ec2 server create -E staging ....`, i.e. in the `staging` environment, the node's run_list is blank.
>
> Is this the expected behavior? I was thinking that the `env_run_lists` items would be added up with the items in the above `run_list` items, just like the rails app's `config/database.yml`

As mentioned on the wiki page, the env run list is an override, so it totally replaces the default non-env run list if the env matches. Otherwise there would be no way to remove items and ordering would be much harder to grok.

--Noah






Archive powered by MHonArc 2.6.16.

§