diff options
Diffstat (limited to 'global')
-rw-r--r-- | global/overlay/etc/puppet/modules/sunet/templates/cloudimage/mk_cloud_image.erb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/global/overlay/etc/puppet/modules/sunet/templates/cloudimage/mk_cloud_image.erb b/global/overlay/etc/puppet/modules/sunet/templates/cloudimage/mk_cloud_image.erb index 9d52a07..7b5b052 100644 --- a/global/overlay/etc/puppet/modules/sunet/templates/cloudimage/mk_cloud_image.erb +++ b/global/overlay/etc/puppet/modules/sunet/templates/cloudimage/mk_cloud_image.erb @@ -53,11 +53,17 @@ instance-id: iid-${id} local-hostname: ${hostname} EOF +dns="" +if [ "x${resolver}" != "x" ]; then + dns="dns-nameservers ${resolver}" +fi + if [ "x${dhcp}" = "xyes" ]; then cat >> ${meta_data} <<EOF network-interfaces: | auto eth0 iface eth0 inet dhcp + ${dns} EOF else if [ "x${ip}" != "x" ]; then @@ -68,7 +74,7 @@ network-interfaces: | address ${ip} netmask ${netmask} gateway ${gateway} - dns-nameservers ${resolver} + ${dns} EOF fi @@ -81,7 +87,7 @@ network-interfaces: | address ${ip6} netmask ${netmask6} gateway ${gateway6} - dns-nameservers ${resolver} + ${dns} EOF fi |