if there are two roles for one chef-client, the script couldn't assign the
roles to the node. fixed it.
This commit is contained in:
parent
f3aae68777
commit
60afd44afc
@ -206,11 +206,18 @@ then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
roles=`echo $roles | sed -e 's/ /,/g'`
|
||||
r="";
|
||||
for onerole in $roles
|
||||
do
|
||||
r+="role[$onerole],"
|
||||
done
|
||||
|
||||
# assign the role for the chef node
|
||||
knife node run_list add $c_fullname "role[$roles]"
|
||||
knife node run_list add $c_fullname "$r"
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
errmsg="Failed to run knife node run_list add $client 'role[$roles]' on the chef-server $NODE."
|
||||
errmsg="Failed to run knife node run_list add $client '$r' on the chef-server $NODE."
|
||||
logger -t xcat -p local4.err $errmsg
|
||||
echo $errmsg
|
||||
exit 1
|
||||
|
Loading…
Reference in New Issue
Block a user