summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2015-05-09 11:29:52 +0200
committerLeif Johansson <leifj@sunet.se>2015-05-09 11:29:52 +0200
commit3b0987256c1f81ef4a5be7d83de564363ca57b28 (patch)
tree76611e67ec8605d9c94a34b05104948f2dd3c88f
parentd9c15efcf1c1e9a87f41a9b3ea70b79df537e12f (diff)
-rw-r--r--global/overlay/etc/puppet/modules/sunet/templates/cloudimage/mk_cloud_image.erb10
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