You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by ma...@apache.org on 2014/03/21 07:02:43 UTC

git commit: Changes for config.sh

Repository: incubator-stratos
Updated Branches:
  refs/heads/master b702edc10 -> 7eabec337


Changes for config.sh

Signed-off-by: Manula Thantriwatte <ma...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/incubator-stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-stratos/commit/7eabec33
Tree: http://git-wip-us.apache.org/repos/asf/incubator-stratos/tree/7eabec33
Diff: http://git-wip-us.apache.org/repos/asf/incubator-stratos/diff/7eabec33

Branch: refs/heads/master
Commit: 7eabec337065c0b986e9b25dad4d4d7415af4fb1
Parents: b702edc
Author: Dinesh Bandara <di...@wso2.com>
Authored: Thu Mar 20 22:33:05 2014 +0530
Committer: Manula Thantriwatte <ma...@apache.org>
Committed: Fri Mar 21 11:32:12 2014 +0530

----------------------------------------------------------------------
 tools/puppet3-agent/config.sh                   |  8 +++--
 tools/puppet3-agent/puppetinstall/puppetinstall | 38 +++++++++-----------
 2 files changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/7eabec33/tools/puppet3-agent/config.sh
----------------------------------------------------------------------
diff --git a/tools/puppet3-agent/config.sh b/tools/puppet3-agent/config.sh
index 3f1bd6c..a9b77e9 100755
--- a/tools/puppet3-agent/config.sh
+++ b/tools/puppet3-agent/config.sh
@@ -29,8 +29,10 @@ WGET=`which wget`
 MKDIR=`which mkdir`
 GREP=`which grep`
 SED=`which sed`
+CP=`which cp`
+MV=`which mv`
 
-
+HOSTSFILE=/etc/hosts
 DATE=`date +%d%m%y%S`
 RANDOMNUMBER="`${TR} -c -d 0-9 < /dev/urandom | ${HEAD} -c 4`${DATE}"
 
@@ -54,6 +56,7 @@ function valid_ip()
 read -p "This script will install and configure puppet agent, do you want to continue [y/N]" answer
 if [[ $answer = y ]] ; then
 
+	${CP} -f ${HOSTSFILE} /etc/hosts.tmp
 	${MKDIR} -p /tmp/payload
 	${WGET} http://169.254.169.254/latest/user-data -O /tmp/payload/launch-params
 
@@ -87,8 +90,9 @@ if [[ $answer = y ]] ; then
 	/root/bin/puppetinstall/puppetinstall "${ARGS[@]}"
         ${RM} /mnt/apache-stratos-cartridge-agent-4.0.0-SNAPSHOT/wso2carbon.lck
 	${GREP} -q '/root/bin/init.sh > /tmp/puppet_log' /etc/rc.local || ${SED} -i 's/exit 0$/\/root\/bin\/init.sh \> \/tmp\/puppet_log\nexit 0/' /etc/rc.local
-	${RM} -rf /tmp/puppet*
+	${RM} -rf /tmp/*
 	${RM} -rf /var/lib/puppet/ssl/*
+	${MV} -f /etc/hosts.tmp ${HOSTSFILE}
 
 fi
 

http://git-wip-us.apache.org/repos/asf/incubator-stratos/blob/7eabec33/tools/puppet3-agent/puppetinstall/puppetinstall
----------------------------------------------------------------------
diff --git a/tools/puppet3-agent/puppetinstall/puppetinstall b/tools/puppet3-agent/puppetinstall/puppetinstall
index 32b0bc3..214edb3 100755
--- a/tools/puppet3-agent/puppetinstall/puppetinstall
+++ b/tools/puppet3-agent/puppetinstall/puppetinstall
@@ -1,27 +1,26 @@
 #!/bin/bash
  
 # Puppet Installer.
+# --------------------------------------------------------------
 #
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
 #
-# Thilina Piyasundara
-# 2014-02-12
-# last updated on : 2014-02-12
+# 	http://www.apache.org/licenses/LICENSE-2.0
 #
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
 #
-# Copyright [2014] [Thilina Piyasundara]
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
+# --------------------------------------------------------------
 
 # Exit on fail
 set -e
@@ -55,8 +54,7 @@ trap bashtrap INT
 
 function print_usage(){
 	${ECHO} -e "Puppet Installer v1 2014-02-12"
-	${ECHO} -e "This script will install PuppetLab puppet v3."
-	${ECHO} -e "Thilina Piyasundara. <ma...@thilina.org>"    
+	${ECHO} -e "This script will install PuppetLab puppet v3."   
 	${ECHO} -e ""
 	${ECHO} -e "Usage: "
 	${ECHO} -e "	puppetinstall [-m|--master or -n|--node <node hostname>] -d <domain> -s <puppet master server ip> "
@@ -85,7 +83,6 @@ function print_usage(){
 	${ECHO} -e "    	Agent hostname will be node001.example.com and will point"
 	${ECHO} -e "    	to the puppet master on 192.168.122.1 server."
 	${ECHO} -e ""
-	${ECHO} -e "Report bugs/issues on https://github.com/thilinapiy/puppetinstall/issues"
 }
 
 function print_message(){
@@ -165,7 +162,6 @@ function get_confirmation(){
 	${ECHO} -e "Please check your input and confirm by pressing [Enter] to continue.	"
 	${ECHO} -e "Or press [Ctrl] + [c] to stop the installationan exit.              	"
 	${ECHO} -e ""
-	${ECHO} -e "Report bugs/issues on https://github.com/thilinapiy/puppetinstall/issues"
 	${ECHO} -e "========================================================================"
 
 	#read input