From fd6fd0e1916f5f7898b0ae999389f3ba951a8d93 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Wed, 13 Sep 2017 20:46:27 +0000 Subject: [PATCH] delete ssh keys with file modules --- tasks/regenerate.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tasks/regenerate.yml b/tasks/regenerate.yml index dc7c7ee..5f88ba9 100644 --- a/tasks/regenerate.yml +++ b/tasks/regenerate.yml @@ -1,7 +1,11 @@ --- - name: delete ssh host keys - shell: rm /etc/ssh/ssh_host_* + file: + path: "{{item}}" + state: absent + with_fileglob: + - /etc/ssh/ssh_host_* register: _ssh_host_keys_delete - name: reconfigure ssh server