Browse Source

regenerate ssh keys

master
parent
commit
ccb7171d49
2 changed files with 15 additions and 0 deletions
  1. +7
    -0
      tasks/main.yml
  2. +8
    -0
      tasks/regenerate.yml

+ 7
- 0
tasks/main.yml View File

@@ -1,5 +1,10 @@
--- ---


- include: regenerate.yml
when:
ssh_host_key_state is defined
and ssh_host_key_state == 'regenerated'

- include: scan.yml - include: scan.yml
when: when:
ssh_host_key_state is defined ssh_host_key_state is defined
@@ -13,5 +18,7 @@
- include: fetch.yml - include: fetch.yml
when: when:
not ssh_host_key_state is defined not ssh_host_key_state is defined
or ( ssh_host_key_state == 'fetched'
and ssh_host_key_state == 'regenerated' )


- include: save.yml - include: save.yml

+ 8
- 0
tasks/regenerate.yml View File

@@ -0,0 +1,8 @@
---

- name: delete ssh host keys
shell: rm /etc/ssh/ssh_host_*
register: _ssh_host_keys_delete

- name: reconfigure ssh server
shell: dpkg-reconfigure openssh-server

Loading…
Cancel
Save