--- - name: delete ssh host keys file: path: "{{item}}" state: absent with_fileglob: - /etc/ssh/ssh_host_* - name: reconfigure ssh server shell: dpkg-reconfigure openssh-server