[chef] Re: Separate role for each real server (virtual machine) ?


Chronological Thread 
  • From: Ranjib Dey < >
  • To:
  • Subject: [chef] Re: Separate role for each real server (virtual machine) ?
  • Date: Thu, 12 Dec 2013 10:10:33 -0800

what will happen if two servers are exactly same? there fqdn cant be same, but you might want to apply the same run list. how you will do that? I have never seen infra with all nodes being unique. also same role does mean same top level run list, but the expanded run list can be different, you can have recipe inclusion based on environments and many other modes.




On Thu, Dec 12, 2013 at 6:05 AM, Vladimir Skubriev < " target="_blank"> > wrote:
What do you think about separate role for each real server (virtual machine) ?


For example we have domain example.com,
nodes:
    server1.example.com,
    server2.example.com

We define a role for each of this server:

role[server1_example_com]
    runlist_of_role:    recipe[apt], recipe[sqlserver]

role[server2_example_com]
    runlist_of_role:    recipe[apt], recipe[mysqlserver]

And suppose I am use a custom script, which is set run list for each rule in chef-repo/roles/*example.com* role's node

#!/bin/bash

# This script setup node's run_list to role[_<node-fqdn-name>] for nodes with defined roles in ../roles directory.
# Only for roles beginning with _ (underline symbol)

# Define roles dir
# By default search a chef-repo/roles directory
CONFIGDIR="../roles"

for role in $CONFIGDIR/*example.com.rb*
do
        node=`basename $role | sed -r 's/^(.*)(.example.com.rb$)/\1/' `
        knife node run_list set "$node.example.com" 'role['$node'.example.com"]'

done

In this case we does not worry about node's run_lists and nodes when reinstalling chef server.

Is i am right ?

And what do you think about one abstract role for one real server ?

--
Best regards,

CVision Lab System Administrator
Vladmir Skubriev





Archive powered by MHonArc 2.6.16.

§