From 7aabf34d7644f3e383037add46b3a67a85e2113a Mon Sep 17 00:00:00 2001 From: jjhua Date: Fri, 5 Jul 2013 03:20:19 +0000 Subject: [PATCH] chef client/workstation installation based on the cfgmgt table git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@16887 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/config_chef_client | 8 +++++--- xCAT/postscripts/config_chef_workstation | 9 +++++---- xCAT/postscripts/install_chef_client | 7 ++++--- xCAT/postscripts/install_chef_workstation | 7 ++++--- xCAT/templates/mypostscript/mypostscript.tmpl | 4 ++++ 5 files changed, 22 insertions(+), 13 deletions(-) diff --git a/xCAT/postscripts/config_chef_client b/xCAT/postscripts/config_chef_client index d159f9043..ac95062d5 100755 --- a/xCAT/postscripts/config_chef_client +++ b/xCAT/postscripts/config_chef_client @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh # IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html @@ -20,8 +20,10 @@ if [ $ARGNUM -gt 1 ]; then fi if [ -z "$chef_server" ]; then - if [ -n "$CFGSERVER" ]; then - chef_server=$CFGSERVER + if [ -n "$CFGSERVER" -a -n "$CFGMGR" ]; then + if [ $CFGMGR = "chef" ]; then + chef_server=$CFGSERVER + fi fi if [ -z "$chef_server" ] then diff --git a/xCAT/postscripts/config_chef_workstation b/xCAT/postscripts/config_chef_workstation index c75b197d8..c17e41cf7 100755 --- a/xCAT/postscripts/config_chef_workstation +++ b/xCAT/postscripts/config_chef_workstation @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh # IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html @@ -24,9 +24,10 @@ fi if [ -z "$chefserver" ] then - if [ -n "$CFGSERVER" ] - then - chefserver=$CFGSERVER + if [ -n "$CFGSERVER" -a -n "$CFGMGR" ]; then + if [ $CFGMGR = "chef" ]; then + chefserver=$CFGSERVER + fi fi if [ -z "$chefserver" ] then diff --git a/xCAT/postscripts/install_chef_client b/xCAT/postscripts/install_chef_client index c340d77c0..69e799e39 100755 --- a/xCAT/postscripts/install_chef_client +++ b/xCAT/postscripts/install_chef_client @@ -52,9 +52,10 @@ fi if [ -z "$chefserver" ] then - if [ -n "$CFGSERVER" ] - then - chefserver=$CFGSERVER + if [ -n "$CFGSERVER" -a -n "$CFGMGR" ]; then + if [ $CFGMGR = "chef" ]; then + chefserver=$CFGSERVER + fi fi if [ -z "$chefserver" ] then diff --git a/xCAT/postscripts/install_chef_workstation b/xCAT/postscripts/install_chef_workstation index 1639610b1..8823ebe19 100755 --- a/xCAT/postscripts/install_chef_workstation +++ b/xCAT/postscripts/install_chef_workstation @@ -53,9 +53,10 @@ fi if [ -z "$chefserver" ] then - if [ -n "$CFGSERVER" ] - then - chefserver=$CFGSERVER + if [ -n "$CFGSERVER" -a -n "$CFGMGR" ]; then + if [ $CFGMGR = "chef" ]; then + chefserver=$CFGSERVER + fi fi if [ -z "$chefserver" ] then diff --git a/xCAT/templates/mypostscript/mypostscript.tmpl b/xCAT/templates/mypostscript/mypostscript.tmpl index 8615698df..05e07433c 100755 --- a/xCAT/templates/mypostscript/mypostscript.tmpl +++ b/xCAT/templates/mypostscript/mypostscript.tmpl @@ -77,6 +77,7 @@ export NTYPE MACADDRESS=#TABLE:mac:$NODE:mac# export MACADDRESS + ## vlan related items. vlan may not be configured. #VLAN_VARS_EXPORT# @@ -114,6 +115,9 @@ export NICCUSTOMSCRIPTS NICNETWORKS=#TABLE:nics:$NODE:nicnetworks# export NICNETWORKS +CFGMGR=#TABLE:cfgmgt:$NODE:cfgmgr# +export CFGMGR + CFGSERVER=#TABLE:cfgmgt:$NODE:cfgserver# export CFGSERVER