BBlack has submitted this change and it was merged.

Change subject: wmf-reimage: support renaming host
......................................................................


wmf-reimage: support renaming host

Change-Id: Id8ce178b0cba095fd34d9461e28c0ea63f18af86
---
M modules/puppetmaster/files/wmf-reimage
1 file changed, 12 insertions(+), 2 deletions(-)

Approvals:
  BBlack: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/puppetmaster/files/wmf-reimage 
b/modules/puppetmaster/files/wmf-reimage
index 8e2fbb7..6c15a0f 100755
--- a/modules/puppetmaster/files/wmf-reimage
+++ b/modules/puppetmaster/files/wmf-reimage
@@ -128,7 +128,7 @@
 
 
 function usage {
-    echo "Usage: $0 [-y][-r][-n][-p][-s SECONDS] <nodename> <mgmtname>"; exit 
1;
+    echo "Usage: $0 [-y][-r][-n][-p][-s SECONDS] <nodename> <mgmtname> 
[<newnodename>]"; exit 1;
 }
 
 ## Main script
@@ -158,15 +158,25 @@
 shift $((OPTIND-1))
 nodename=${1:-}
 mgmtname=${2:-}
+newnodename=${3:-}
 test -z ${nodename} && usage
 test -z ${mgmtname} && usage
-log "Preparing reimaging of node ${nodename}"
+if [ -z ${newnodename} ]; then
+    log "Preparing reimaging of node ${nodename}"
+else
+    log "Preparing reimaging of node ${nodename} to new hostname 
${newnodename} (interface should already be on new network if applicable)"
+fi
 
 if [ $NOCLEAN -eq 0 ]; then
     clean_puppet $nodename
     clean_salt $nodename $FORCE
 fi;
 test $NOREBOOT -eq 0 && set_pxe_and_reboot $mgmtname
+
+if [ -z ${newnodename} ]; then
+    nodename=$newnodename
+fi
+
 sign_puppet $nodename $FORCE
 if [ $RUNPUPPET -eq 1 ]; then
     enable_and_run_puppet $nodename

-- 
To view, visit https://gerrit.wikimedia.org/r/194739
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id8ce178b0cba095fd34d9461e28c0ea63f18af86
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to