]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
cobbler: Regenerate SSH host keys on Ubuntu firstboot if necessary 346/head
authorDavid Galloway <dgallowa@redhat.com>
Mon, 27 Nov 2017 19:03:08 +0000 (14:03 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Mon, 27 Nov 2017 19:03:08 +0000 (14:03 -0500)
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/cobbler/templates/snippets/cephlab_rc_local

index bc4a642a89ce8ced861615139d367f964d8c1c58..4bf384f354e9cd0f9b2c5ebb1f7e0ca90a8a67cf 100644 (file)
@@ -85,9 +85,16 @@ if [ -n "$myips" ]; then
   done
 fi
 
-#end raw
 {% endif %}
 
+# Regenerate SSH host keys on boot if needed
+if command -v apt-get &>/dev/null; then
+  if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
+     dpkg-reconfigure openssh-server
+  fi
+fi
+#end raw
+
 # Only run once.
 if [ -e $lockfile ]; then
     exit 0