diff --git a/modules/openstack_project/files/nodepool/scripts/prepare_node.sh b/modules/openstack_project/files/nodepool/scripts/prepare_node.sh index 3bbf56b98b..5d32b1a411 100755 --- a/modules/openstack_project/files/nodepool/scripts/prepare_node.sh +++ b/modules/openstack_project/files/nodepool/scripts/prepare_node.sh @@ -32,7 +32,7 @@ forward-zone: EOF sudo hostname $HOSTNAME -if ! grep -q $HOSTNAME /etc/hosts +if [ -n "$HOSTNAME" ] && ! grep -q $HOSTNAME /etc/hosts then echo "127.0.1.1 $HOSTNAME" | sudo tee -a /etc/hosts fi