forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hostname patch for vsphere provider limitations with juju
This patch sets the hostname to a unique identifier (the juju unit name) during pre-deployment of the charm. This may not be a FQDN resolveable hostname but will prevent hostname collision.
- Loading branch information
Charles Butler
committed
Apr 21, 2017
1 parent
f613e66
commit 32acffc
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
cluster/juju/layers/kubernetes-master/exec.d/vmware-patch/charm-pre-install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
MY_HOSTNAME=$(hostname) | ||
|
||
: ${JUJU_UNIT_NAME:=`uuidgen`} | ||
|
||
|
||
if [ "${MY_HOSTNAME}" == "ubuntuguest" ]; then | ||
juju-log "Detected broken vsphere integration. Applying hostname override" | ||
|
||
FRIENDLY_HOSTNAME=$(echo $JUJU_UNIT_NAME | tr / -) | ||
juju-log "Setting hostname to $FRIENDLY_HOSTNAME" | ||
if [ ! -f /etc/hostname.orig ]; then | ||
mv /etc/hostname /etc/hostname.orig | ||
fi | ||
echo "${FRIENDLY_HOSTNAME}" > /etc/hostname | ||
hostname $FRIENDLY_HOSTNAME | ||
fi |
17 changes: 17 additions & 0 deletions
17
cluster/juju/layers/kubernetes-worker/exec.d/vmware-patch/charm-pre-install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
MY_HOSTNAME=$(hostname) | ||
|
||
: ${JUJU_UNIT_NAME:=`uuidgen`} | ||
|
||
|
||
if [ "${MY_HOSTNAME}" == "ubuntuguest" ]; then | ||
juju-log "Detected broken vsphere integration. Applying hostname override" | ||
|
||
FRIENDLY_HOSTNAME=$(echo $JUJU_UNIT_NAME | tr / -) | ||
juju-log "Setting hostname to $FRIENDLY_HOSTNAME" | ||
if [ ! -f /etc/hostname.orig ]; then | ||
mv /etc/hostname /etc/hostname.orig | ||
fi | ||
echo "${FRIENDLY_HOSTNAME}" > /etc/hostname | ||
hostname $FRIENDLY_HOSTNAME | ||
fi |