浏览代码

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

正在加载...
取消
保存