瀏覽代碼

regenerate ssh keys

master
父節點
當前提交
ccb7171d49
共有 2 個檔案被更改,包括 15 行新增0 行删除
  1. +7
    -0
      tasks/main.yml
  2. +8
    -0
      tasks/regenerate.yml

+ 7
- 0
tasks/main.yml 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存