From 4e542a8e15596421a9120cf700f0d4d12dbf6688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Sun, 5 Dec 2021 19:58:05 +0000 Subject: roles: Add sshd role for configuration generation --- roles/sshd/tasks/main.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 roles/sshd/tasks/main.yml (limited to 'roles/sshd/tasks/main.yml') diff --git a/roles/sshd/tasks/main.yml b/roles/sshd/tasks/main.yml new file mode 100644 index 0000000..f9131e9 --- /dev/null +++ b/roles/sshd/tasks/main.yml @@ -0,0 +1,19 @@ +- name: generate sshd configuration + template: + src: sshd_config.j2 + dest: /etc/ssh/sshd_config + owner: 0 + group: 0 + mode: 0644 + +- name: enabled and restart sshd + service: + name: sshd + state: restarted + enabled: true + +- name: check ssh connection + wait_for: + port: 22 + delay: 1 + state: started -- cgit v1.2.3