aboutsummaryrefslogtreecommitdiffstats
path: root/roles/sshd/tasks/main.yml
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2021-12-05 19:58:05 +0000
committerRomain Gonçalves <me@rgoncalves.se>2021-12-05 21:03:22 +0000
commit4e542a8e15596421a9120cf700f0d4d12dbf6688 (patch)
treeb7cd1c2c87acd27760110bf3b9534d7f159f0a7d /roles/sshd/tasks/main.yml
parent1f21f49f197d6f189952f6e7b1a0a21ebb86487b (diff)
downloadrules-4e542a8e15596421a9120cf700f0d4d12dbf6688.tar.gz
roles: Add sshd role for configuration generation
Diffstat (limited to 'roles/sshd/tasks/main.yml')
-rw-r--r--roles/sshd/tasks/main.yml19
1 files changed, 19 insertions, 0 deletions
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
remember that computers suck.