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


Chronological Thread 
  • From: Vladimir Skubriev < >
  • To:
  • Subject: [chef] Re: Re: Separate role for each real server (virtual machine) ?
  • Date: Fri, 13 Dec 2013 11:57:33 +0400

13.12.2013 10:49, Morgan Blackthorne пишет:
You can do it this way, or just manage the node data (ie, run list, environment) directly in the chef repo with JSON files and "knife node from file nodes/*.json". You can seed these files initially with knife-backup of your current nodes.
Thank you for support.
Just in case, here is my working script:

#!/bin/bash

# This script setup node's run_list to role[node_domain_name>] for nodes with defined roles in ../roles directory.
# Only for roles with domain name as _cvision_lab

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

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

done


)))

I verify this method. It works.

--
Best regards,

CVision Lab System Administrator
Vladmir Skubriev




Archive powered by MHonArc 2.6.16.

§