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?
:~# 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?
--
Att.
Bruno Galindro da Costa