Change-Id: I488851ded40e88180359d545259ec0631416d32d
Signed-off-by: Stefan K. Berg <stefan.k.berg@ericsson.com>
awk -F\= '$1 == "ID_NET_NAME_ONBOARD" {s=$2; exit}; $1 == "ID_NET_NAME_SLOT" {s=$2; exit}; $1 == "ID_NET_NAME_PATH" {s=$2; next}; END {print s}')" >> /root/anaconda.cmdline.vars
fi
+# Add self entry to /etc/hosts
+ipaddr=$(echo $ip | cut -d: -f1)
+hostname=$(echo $ip | cut -d: -f5)
+# Use default hostname if missing from parameters
+[ -z "$hostname" ] && hostname="fuel.domain.tld"
+short=$(echo $hostname | cut -d. -f1)
+echo -e "${ipaddr} ${hostname} ${short}" >> /etc/hosts
%end
awk -F\= '$1 == "ID_NET_NAME_ONBOARD" {s=$2; exit}; $1 == "ID_NET_NAME_SLOT" {s=$2; exit}; $1 == "ID_NET_NAME_PATH" {s=$2; next}; END {print s}')" >> /root/anaconda.cmdline.vars
fi
+# Add self entry to /etc/hosts
+ipaddr=$(echo $ip | cut -d: -f1)
+hostname=$(echo $ip | cut -d: -f5)
+# Use default hostname if missing from parameters
+[ -z "$hostname" ] && hostname="fuel.domain.tld"
+short=$(echo $hostname | cut -d. -f1)
+echo -e "${ipaddr} ${hostname} ${short}" >> /etc/hosts
%end