[chef] Re: Environment run_list


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Environment run_list
  • Date: Mon, 17 Nov 2014 09:57:31 -0800

On Monday, November 17, 2014 at 9:15 AM, Bruno Galindro da Costa wrote:
> This is my node:
>  
> {
> "name": "SV-API",
> "chef_environment": "Producao",
> "run_list": [
> "role[Api]"
> ],
> "normal": {
> "tags": [
>  
> ]
> }
> }
>  
> This is my Role:
>  
> {
> "name": "Api",
> "description": "",
> "json_class": "Chef::Role",
> "default_attributes": {
> },
> "override_attributes": {
> },
> "chef_type": "role",
> "run_list": [
> "role[Web]",
> "recipe[php::module_ldap]",
> "recipe[set_hosts]",
> "recipe[web_app::apache2_web_app]"
> ],
> "env_run_lists": {
> "Producao": [
>  
> ]
> }
> }
>  
> As I understand, according to 
> http://docs.getchef.com/essentials_roles.html#set-per-environment-run-lists,
>  if the env_run_lists of an environment is empty, the default run-list will 
> be applied. But, when I execute chef-client in my node SV-API, the run-list 
> is empty. Why?

The example code is maybe a little confusing. Anyway, what you’ve done is 
specified an empty run list for that environment. If you want to use the 
default in the ‘Producao’ environment, then remove that key from 
env_run_lists.
  
>  
>  
>  :~#
>  chef-client  
>  
> Starting Chef Client, version 11.12.8
> resolving cookbooks for run list: []
> Synchronizing Cookbooks:
> Compiling Cookbooks...
> Converging 0 resources
>  
> Running handlers:
> Running handlers complete
>  
> Chef Client finished, 0/0 resources updated in 6.925981801 seconds
>  
>  
>  
> What I need is to have a set of recipes and roles that can be executed in 
> every node, independent if the node is part of an environment defined by me 
> or part of _default environment. So, If the node is part of an environment 
> defined by me (in my case Producao), I could, for example, add some roles 
> or recipes that will be merged with the default run-list defined in 
> "run_list" key, avoiding duplications.
>  
> Is it possible to make Chef work in this way?
Environment run_lists in roles are pretty ugly. Do you have a lot of these 
nodes? Could you just manage the run lists on the relevant nodes instead?
  
>  
>  
> --  
> Att.
> Bruno Galindro da Costa



--  
Daniel DeLeo






Archive powered by MHonArc 2.6.16.

§