Merge "Shells Out Getting hostname"
This commit is contained in:
commit
ee7fc61fb3
|
@ -63,9 +63,14 @@ if [[ ! "$YN_IP" =~ ^([yY]|"")$ ]]; then
|
||||||
read -p "What is your LOCAL IP? " LOCAL_IP
|
read -p "What is your LOCAL IP? " LOCAL_IP
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Shells out to get the hostname to avoid some config conflicts
|
||||||
|
set -x
|
||||||
|
SHORT_HOSTNAME=$(hostname -s)
|
||||||
|
set +x
|
||||||
|
|
||||||
# Updates the /etc/hosts file
|
# Updates the /etc/hosts file
|
||||||
HOSTS="${LOCAL_IP} ${HOSTNAME}"
|
HOSTS="${LOCAL_IP} ${SHORT_HOSTNAME}"
|
||||||
HOSTS_REGEX="${LOCAL_IP}.*${HOSTNAME}"
|
HOSTS_REGEX="${LOCAL_IP}.*${SHORT_HOSTNAME}"
|
||||||
if grep -q "$HOSTS_REGEX" "/etc/hosts"; then
|
if grep -q "$HOSTS_REGEX" "/etc/hosts"; then
|
||||||
echo "Not updating /etc/hosts, entry ${HOSTS} already exists."
|
echo "Not updating /etc/hosts, entry ${HOSTS} already exists."
|
||||||
else
|
else
|
||||||
|
|
|
@ -37,7 +37,7 @@ TARGET_SITE=${TARGET_SITE:-"dev"}
|
||||||
# The hostname for the genesis node
|
# The hostname for the genesis node
|
||||||
|
|
||||||
# The host name for the single-node deployment. e.g.: 'genesis'
|
# The host name for the single-node deployment. e.g.: 'genesis'
|
||||||
HOSTNAME=${HOSTNAME:-""}
|
SHORT_HOSTNAME=${SHORT_HOSTNAME:-""}
|
||||||
# The host ip for this single-node deployment. e.g.: '10.0.0.9'
|
# The host ip for this single-node deployment. e.g.: '10.0.0.9'
|
||||||
HOSTIP=${HOSTIP:-""}
|
HOSTIP=${HOSTIP:-""}
|
||||||
# The cidr for the network for the host. e.g.: '10.0.0.0/24'
|
# The cidr for the network for the host. e.g.: '10.0.0.0/24'
|
||||||
|
@ -72,8 +72,8 @@ function check_preconditions() {
|
||||||
echo "The HOSTIP variable must be set. E.g. 10.0.0.9"
|
echo "The HOSTIP variable must be set. E.g. 10.0.0.9"
|
||||||
fail=true
|
fail=true
|
||||||
fi
|
fi
|
||||||
if [ -z ${HOSTNAME} ] ; then
|
if [ -z ${SHORT_HOSTNAME} ] ; then
|
||||||
echo "The HOSTNAME variable must be set. E.g. testvm1"
|
echo "The SHORT_HOSTNAME variable must be set. E.g. testvm1"
|
||||||
fail=true
|
fail=true
|
||||||
fi
|
fi
|
||||||
if [ -z ${HOSTCIDR} ] ; then
|
if [ -z ${HOSTCIDR} ] ; then
|
||||||
|
@ -84,9 +84,9 @@ function check_preconditions() {
|
||||||
echo "The NODE_NET_IFACE variable must be set. E.g. ens3"
|
echo "The NODE_NET_IFACE variable must be set. E.g. ens3"
|
||||||
fail=true
|
fail=true
|
||||||
fi
|
fi
|
||||||
if [[ -z $(grep $HOSTNAME /etc/hosts | grep $HOSTIP) ]]
|
if [[ -z $(grep $SHORT_HOSTNAME /etc/hosts | grep $HOSTIP) ]]
|
||||||
then
|
then
|
||||||
echo "No /etc/hosts entry found for $HOSTNAME. Please add one."
|
echo "No /etc/hosts entry found for $SHORT_HOSTNAME. Please add one."
|
||||||
fail=true
|
fail=true
|
||||||
fi
|
fi
|
||||||
if [ $fail = true ] ; then
|
if [ $fail = true ] ; then
|
||||||
|
@ -134,7 +134,7 @@ function setup_repos() {
|
||||||
function configure_dev_configurables() {
|
function configure_dev_configurables() {
|
||||||
cat << EOF >> ${WORKSPACE}/airship-in-a-bottle/deployment_files/site/${TARGET_SITE}/deployment/dev-configurables.yaml
|
cat << EOF >> ${WORKSPACE}/airship-in-a-bottle/deployment_files/site/${TARGET_SITE}/deployment/dev-configurables.yaml
|
||||||
data:
|
data:
|
||||||
hostname: ${HOSTNAME}
|
hostname: ${SHORT_HOSTNAME}
|
||||||
hostip: ${HOSTIP}
|
hostip: ${HOSTIP}
|
||||||
hostcidr: ${HOSTCIDR}
|
hostcidr: ${HOSTCIDR}
|
||||||
interface: ${NODE_NET_IFACE}
|
interface: ${NODE_NET_IFACE}
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
# frequently changed
|
# frequently changed
|
||||||
|
|
||||||
# The hostname for the genesis node
|
# The hostname for the genesis node
|
||||||
export HOSTNAME=testvm1
|
export SHORT_HOSTNAME=testvm1
|
||||||
# The IP address of the genesis node
|
# The IP address of the genesis node
|
||||||
export HOSTIP=10.0.0.9
|
export HOSTIP=10.0.0.9
|
||||||
# The CIDR of the network for the genesis node
|
# The CIDR of the network for the genesis node
|
||||||
|
|
Loading…
Reference in New Issue