diff --git a/manifests/dev_single_node/airship-in-a-bottle.sh b/manifests/dev_single_node/airship-in-a-bottle.sh index c9857447..2ae13daf 100755 --- a/manifests/dev_single_node/airship-in-a-bottle.sh +++ b/manifests/dev_single_node/airship-in-a-bottle.sh @@ -63,9 +63,14 @@ if [[ ! "$YN_IP" =~ ^([yY]|"")$ ]]; then read -p "What is your LOCAL IP? " LOCAL_IP 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 -HOSTS="${LOCAL_IP} ${HOSTNAME}" -HOSTS_REGEX="${LOCAL_IP}.*${HOSTNAME}" +HOSTS="${LOCAL_IP} ${SHORT_HOSTNAME}" +HOSTS_REGEX="${LOCAL_IP}.*${SHORT_HOSTNAME}" if grep -q "$HOSTS_REGEX" "/etc/hosts"; then echo "Not updating /etc/hosts, entry ${HOSTS} already exists." else diff --git a/manifests/dev_single_node/deploy-airship.sh b/manifests/dev_single_node/deploy-airship.sh index 83a9e7e4..ec45d7bd 100755 --- a/manifests/dev_single_node/deploy-airship.sh +++ b/manifests/dev_single_node/deploy-airship.sh @@ -37,7 +37,7 @@ TARGET_SITE=${TARGET_SITE:-"dev"} # The hostname for the genesis node # 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' HOSTIP=${HOSTIP:-""} # 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" fail=true fi - if [ -z ${HOSTNAME} ] ; then - echo "The HOSTNAME variable must be set. E.g. testvm1" + if [ -z ${SHORT_HOSTNAME} ] ; then + echo "The SHORT_HOSTNAME variable must be set. E.g. testvm1" fail=true fi if [ -z ${HOSTCIDR} ] ; then @@ -84,9 +84,9 @@ function check_preconditions() { echo "The NODE_NET_IFACE variable must be set. E.g. ens3" fail=true fi - if [[ -z $(grep $HOSTNAME /etc/hosts | grep $HOSTIP) ]] + if [[ -z $(grep $SHORT_HOSTNAME /etc/hosts | grep $HOSTIP) ]] 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 fi if [ $fail = true ] ; then @@ -134,7 +134,7 @@ function setup_repos() { function configure_dev_configurables() { cat << EOF >> ${WORKSPACE}/airship-in-a-bottle/deployment_files/site/${TARGET_SITE}/deployment/dev-configurables.yaml data: - hostname: ${HOSTNAME} + hostname: ${SHORT_HOSTNAME} hostip: ${HOSTIP} hostcidr: ${HOSTCIDR} interface: ${NODE_NET_IFACE} diff --git a/manifests/dev_single_node/set-env.sh b/manifests/dev_single_node/set-env.sh index 1aafff35..06f8b3d2 100644 --- a/manifests/dev_single_node/set-env.sh +++ b/manifests/dev_single_node/set-env.sh @@ -24,7 +24,7 @@ # frequently changed # The hostname for the genesis node -export HOSTNAME=testvm1 +export SHORT_HOSTNAME=testvm1 # The IP address of the genesis node export HOSTIP=10.0.0.9 # The CIDR of the network for the genesis node