2014-11-19 14:42:19 +00:00
|
|
|
#!/bin/bash
|
2013-04-08 06:27:25 +00:00
|
|
|
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
|
|
|
|
|
2014-06-10 15:54:31 +00:00
|
|
|
|
2014-07-23 06:16:48 +00:00
|
|
|
if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then
|
|
|
|
str_dir_name=`dirname $0`
|
|
|
|
. $str_dir_name/xcatlib.sh
|
|
|
|
fi
|
2014-06-10 15:54:31 +00:00
|
|
|
|
|
|
|
|
2013-04-08 06:27:25 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
#=head1 configure_chef_server
|
|
|
|
#=head2 This command configures the chef server on a xCAT node.
|
|
|
|
# It is used by install_chef_client on Ubuntu and chef kit on RH.
|
|
|
|
# It also can be used postscripts on diskless
|
|
|
|
# usage:
|
|
|
|
# 1. configure the chef server using updatenode
|
|
|
|
# updatenode <noderange> -P "config_chef_server"
|
|
|
|
# 2. configure chef server during os provisioning
|
|
|
|
# chef <noderange> -p postscripts=config_chef_server
|
|
|
|
#=cut
|
|
|
|
#-------------------------------------------------------------------------------
|
2013-04-10 09:32:49 +00:00
|
|
|
HOME='/root/'
|
|
|
|
export HOME
|
2013-04-09 08:02:15 +00:00
|
|
|
/usr/bin/chef-server-ctl reconfigure
|
2013-04-08 06:27:25 +00:00
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
|
|
|
errmsg="Failed to run chef-server-ctl reconfigure on $node"
|
|
|
|
logger -t xcat -p local4.err $errmsg
|
|
|
|
echo $errmsg
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2013-10-22 14:22:39 +00:00
|
|
|
# for ubuntu
|
|
|
|
if [ -e "/etc/lsb-release" ]
|
|
|
|
then
|
|
|
|
apt-get install nfs-kernel-server portmap nfs-common -y
|
|
|
|
|
|
|
|
grep "/etc/chef-server" /etc/exports
|
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
|
|
|
echo -e "\n/etc/chef-server *(rw,no_root_squash,sync,no_subtree_check)\n" >> /etc/exports
|
|
|
|
fi
|
2014-06-10 15:54:31 +00:00
|
|
|
#sudo /etc/init.d/nfs-kernel-server restart
|
|
|
|
sudo restartservice nfs-kernel-server
|
2013-10-22 14:22:39 +00:00
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
|
|
|
errmsg="Failed to run sudo /etc/init.d/nfs-kernel-server restart on $node"
|
|
|
|
logger -t xcat -p local4.err $errmsg
|
|
|
|
echo $errmsg
|
|
|
|
exit 1
|
|
|
|
fi
|
2014-06-10 15:54:31 +00:00
|
|
|
#service portmap restart
|
|
|
|
startservice portmap
|
2013-10-22 14:22:39 +00:00
|
|
|
if [ $? -ne 0 ]
|
|
|
|
then
|
|
|
|
errmsg="Failed to run service portmap restart on $node"
|
|
|
|
logger -t xcat -p local4.err $errmsg
|
|
|
|
echo $errmsg
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2013-04-08 06:27:25 +00:00
|
|
|
exit 0;
|