Bläddra i källkod

regenerate ssh keys

master
förälder
incheckning
ccb7171d49
2 ändrade filer med 15 tillägg och 0 borttagningar
  1. +7
    -0
      tasks/main.yml
  2. +8
    -0
      tasks/regenerate.yml

+ 7
- 0
tasks/main.yml Visa fil

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

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

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

- include: save.yml

+ 8
- 0
tasks/regenerate.yml Visa fil

@@ -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

Laddar…
Avbryt
Spara