]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
tools: Delete ssh keys so FOG-imaged machines regenerate on firstboot 353/head
authorDavid Galloway <dgallowa@redhat.com>
Mon, 27 Nov 2017 18:42:31 +0000 (13:42 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Mon, 27 Nov 2017 19:04:23 +0000 (14:04 -0500)
Signed-off-by: David Galloway <dgallowa@redhat.com>
tools/prep-fog-capture.yml

index ddb7f184b92aab803eede83d62896a3e1beceb34..416cce7fbeac1ed5f3f04521c8b1cbd99863dca2 100644 (file)
     mount:
       path: /var/lib/ceph
       state: unmounted
+
+  - name: Get list of SSH host keys
+    shell: "ls -1 /etc/ssh/ssh_host_*"
+    register: ssh_host_keys
+    ignore_errors: true
+
+  # Key regeneration is done automatically on CentOS firstboot.
+  # For Ubuntu, we'll add `dpkg-reconfigure openssh-server` to rc.local
+  - name: Delete SSH host keys so they're generated during firstboot on cloned machines
+    file:
+      path: "{{ item }}"
+      state: absent
+    with_items: "{{ ssh_host_keys.stdout_lines|default([]) }}"
+    when: ssh_host_keys is defined