ssh_host_keys

This commit is contained in:
2025-05-28 11:09:56 +02:00
parent f0a78236c7
commit 6679277418
4 changed files with 63 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
---
- name: Reconfigure sshd
ansible.builtin.command: dpkg-reconfigure openssh-server
changed_when: true
- name: Restart sshd
ansible.builtin.service:
name: ssh
state: restarted
- name: Removing ssh host public and private keys
ansible.builtin.file:
path: "{{ item.1 }}"
state: absent
register: state_pub
with_subelements:
- "{{ ssh_host_keys_keys }}"
- files
notify:
- Reconfigure sshd
- Restart sshd