[chef] Re: [[chef-dev]] [chef-dev] Grouping servers for a better overview


Chronological Thread 
  • From: Daniel DeLeo < >
  • To: WEINHAPL Andreas < >
  • Cc: " " < >, " " < >
  • Subject: [chef] Re: [[chef-dev]] [chef-dev] Grouping servers for a better overview
  • Date: Tue, 8 Mar 2011 08:21:27 -0800

On Monday, March 7, 2011 at 11:32 PM, WEINHAPL Andreas wrote:

So I will describe it a little bit. In our environment we don’t have only Windos / Ubuntu/Debian /RH servers (just like you J ). So my problem is that we want to create a maintenance role for updating these servers! But here is the problem. If you see the server name doesn’t describe the function or the OS running on it. Is there a way to create “server-groups” which include only windows servers or something like this because with these groups we can easily put a the correct “maintenance-role” (cookbooks for maintenance) to them if they are needed.

Probably the best way to go about this is to have a single maintenance cookbook which will selectively include recipes based on platform. It'd look something like this:

    case node.platform
    when :debian
      include_recipe("maintenance::debian")
    when :ubuntu
      include_recipe("mainentance::ubuntu")
    else
      # ...
    end

The other option, if you already have the nodes in chef, is to use shef or a knife exec script to search for the nodes by platform and edit their run lists programmatically. There's a bit of documentation here: http://wiki.opscode.com/display/chef/Shef#Shef-ManagingChefServerwithShef but the most comprehensive documentation is available by running shef and using the `help` command. In particular, you want to use the `nodes.transform` command.

 

 

Best regards

Andreas Weinhapl

HTH,

-- 
Dan DeLeo




Archive powered by MHonArc 2.6.16.

§