summaryrefslogtreecommitdiff
path: root/global/overlay/etc/puppet/modules/sunet/templates
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2015-05-09 16:33:00 +0200
committerLeif Johansson <leifj@sunet.se>2015-05-09 16:33:00 +0200
commitdb67305282bec64dfe081099b14697adc83ebb02 (patch)
tree8090e5e42a5b50b4df6769783ab643ebf25c1c9d /global/overlay/etc/puppet/modules/sunet/templates
parent8098a9e3bbc4d3ae92880243a9b7fb554750afba (diff)
force ssh key on rootsunet-ops-2015-05-09-v07
Diffstat (limited to 'global/overlay/etc/puppet/modules/sunet/templates')
-rw-r--r--global/overlay/etc/puppet/modules/sunet/templates/cloudimage/mk_cloud_image.erb10
1 files changed, 7 insertions, 3 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 2f76078..13c4f17 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
@@ -18,6 +18,7 @@ resolver="<%= @resolver %>"
ip6="<%= @ip6 %>"
gateway6="<%= @gateway6 %>"
netmask6="<%= @netmask6 %>"
+password="<%= @password %>"
cd "/var/lib/libvirt/cloud-init"
@@ -31,12 +32,15 @@ rm -f ${seed}
truncate --size 2M ${seed}
mkfs.vfat -n cidata ${seed} 2>/dev/null
+if [ "x${password}" != "x" ]; then
+ pass="password: ${password}"
+fi
+
user_data=$(mktemp)
cat > ${user_data} <<EOF
#cloud-config
-password: ubuntu
-chpasswd: { expire: False }
-ssh_pwauth: True
+user: root
+ssh_pwauth: False
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDVvB4gdJ6EWRmx8xUSxrhoUNnWxEf8ZwAqhzC1+7XBY/hSd/cbEotLB9gxgqt0CLW56VU4FPLTw8snD8tgsyZN6KH1Da7UXno8oMk8tJdwLQM0Ggx3aWuztItkDfBc3Lfvq5T07YfphqJO7rcSGbS4QQdflXuOM9JLi6NStVao0ia4aE6Tj68pVVb3++XYvqvbU6NtEICvkTxEY93YpnRSfeAi64hsbaqSTN4kpeltzoSD1Rikz2aQFtFXE03ZC48HtGGhdMFA/Ade6KWBDaXxHGARVQ9/UccfhaR2XSjVxSZ8FBNOzNsH4k9cQIb2ndkEOXZXnjF5ZjdI4ZU0F+t7 leifj+00060AD478D6@sunet.se
runcmd: