launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #11521
[Merge] lp:~andreserl/maas/maas_preseed_userdata_hostname into lp:maas
Andres Rodriguez has proposed merging lp:~andreserl/maas/maas_preseed_userdata_hostname into lp:maas.
Requested reviews:
MAAS Maintainers (maas-maintainers)
For more details, see:
https://code.launchpad.net/~andreserl/maas/maas_preseed_userdata_hostname/+merge/122340
--
https://code.launchpad.net/~andreserl/maas/maas_preseed_userdata_hostname/+merge/122340
Your team MAAS Maintainers is requested to review the proposed merge of lp:~andreserl/maas/maas_preseed_userdata_hostname into lp:maas.
=== modified file 'contrib/preseeds_v2/enlist_userdata'
--- contrib/preseeds_v2/enlist_userdata 2012-08-14 09:24:03 +0000
+++ contrib/preseeds_v2/enlist_userdata 2012-08-31 19:02:20 +0000
@@ -8,7 +8,10 @@
# we could obtain the interface that booted from the kernel cmdline
# thanks to 'IPAPPEND' (http://www.syslinux.org/wiki/index.php/SYSLINUX)
url="{{server_url}}"
- maas-enlist --serverurl "$url" >/tmp/enlist.out
+ host=""
+ ip=$(ifconfig eth0 | awk '$1 == "inet" { sub("addr:","",$2); print $2; }') &&
+ [ -n "${ip}" ] && host=$(dig +short -x $ip) && host=${host%.}
+ maas-enlist --serverurl "$url" ${host:+--hostname "${host}"} >/tmp/enlist.out
if [ $? -eq 0 ]; then
echo
echo "=== $(date -R): successfully enlisted system to $host ==="
Follow ups