We have been using Chef in a single “logical” site config for a couple of years in the sense that all of our nodes share a set of “global” attributes that for better or worse come from (here it comes) roles. We test changes to the “global” attributes by overriding them in host or group specific roles before modifying anything in the global scope.
We know about the concept of role cookbooks and the possible benefits this can give in terms of versioning and dynamic/programatic capabilities that cookbooks can provide. Moving all our roles to role cookbooks is not something we want to do right now from both the amount of work this would take and dealing the precedence changes that moving from role file to attribute/cookbook files would cause
We have grown our environment and now are moving into a multi site configuration where there is much smaller “global” role data and now site level role data for each location that we have servers in. In the past the first entry in all our nodes run_list was simply “role[server_base]” What we want now is for all our servers to have two entries as the first part of the overall run_list “role[server_base], role[server_base_site]” where site is the actual name of the site that a server lives in.
There are a few way that I can accomplish this but I want to find out of the way that I want to accomplish this is possible.
We have a custom Ohai plugin that gives us the site name as an automatic attribute. What I want to do is at the start of every chef run inspect the run_list, set the 1st two entries of the run_list if not correct, save the node and restart the convergence within an existing convergence.
I believe that I can modify and save the run_list during a convergence via the simple paradigm of
What I do not know how to do is restart the convergence within the run itself. Can someone tell me if this is possible. All and any help is greatly appreciated. Thanks!