Add the new hostname to /etc/hosts in prepare_node
It is good practice to update /etc/hosts with the new hostname when changing it. Some programs (such as sudo) will give warnings if it is unable to resolve its own name. Change-Id: I5c95c9cadc32d7d42c6c6546e136a80f4a7e02f4
This commit is contained in:
parent
54a0913638
commit
67b2919e0b
@ -31,6 +31,11 @@ forward-zone:
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
sudo hostname $HOSTNAME
|
sudo hostname $HOSTNAME
|
||||||
|
if ! grep -q $HOSTNAME /etc/hosts
|
||||||
|
then
|
||||||
|
echo "127.0.1.1 $HOSTNAME" | sudo tee -a /etc/hosts
|
||||||
|
fi
|
||||||
|
|
||||||
# Fedora image doesn't come with wget
|
# Fedora image doesn't come with wget
|
||||||
if [ -f /usr/bin/yum ]; then
|
if [ -f /usr/bin/yum ]; then
|
||||||
sudo yum -y install wget
|
sudo yum -y install wget
|
||||||
|
Loading…
x
Reference in New Issue
Block a user