mirror of
https://github.com/roles-ansible/ansible_role_sshd.git
synced 2024-08-16 11:59:49 +02:00
Generate new ed25519 host key if necessary
This commit is contained in:
parent
3d22817eff
commit
a5c894a7f4
1 changed files with 15 additions and 0 deletions
|
@ -7,6 +7,17 @@
|
||||||
group: root
|
group: root
|
||||||
mode: 'u=rw,g=r,o=r'
|
mode: 'u=rw,g=r,o=r'
|
||||||
validate: /usr/sbin/sshd -t -f %s
|
validate: /usr/sbin/sshd -t -f %s
|
||||||
|
notify:
|
||||||
|
- restart ssh
|
||||||
|
|
||||||
|
|
||||||
|
- name: Generate new ed25519 ssh host key pair if necessary
|
||||||
|
command: ssh-keygen -t ed25519 -f 'ssh_host_ed25519_key' -P '' -q
|
||||||
|
args:
|
||||||
|
chdir: '/etc/ssh/'
|
||||||
|
creates: 'ssh_host_ed25519_key.pub'
|
||||||
|
notify:
|
||||||
|
- restart ssh
|
||||||
|
|
||||||
|
|
||||||
- name: Remove unwanted host keys
|
- name: Remove unwanted host keys
|
||||||
|
@ -17,6 +28,8 @@
|
||||||
- ecdsa
|
- ecdsa
|
||||||
- rsa
|
- rsa
|
||||||
- dsa
|
- dsa
|
||||||
|
notify:
|
||||||
|
- restart ssh
|
||||||
- file:
|
- file:
|
||||||
path: '/etc/ssh/ssh_host_{{ item }}_key.pub'
|
path: '/etc/ssh/ssh_host_{{ item }}_key.pub'
|
||||||
state: absent
|
state: absent
|
||||||
|
@ -24,3 +37,5 @@
|
||||||
- ecdsa
|
- ecdsa
|
||||||
- rsa
|
- rsa
|
||||||
- dsa
|
- dsa
|
||||||
|
notify:
|
||||||
|
- restart ssh
|
||||||
|
|
Loading…
Reference in a new issue