aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/sshd/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/sshd/tasks/main.yml')
-rw-r--r--roles/sshd/tasks/main.yml16
1 files changed, 16 insertions, 0 deletions
diff --git a/roles/sshd/tasks/main.yml b/roles/sshd/tasks/main.yml
new file mode 100644
index 0000000..d31ac79
--- /dev/null
+++ b/roles/sshd/tasks/main.yml
@@ -0,0 +1,16 @@
+- name: Configure sshd
+ become: true
+ ansible.builtin.template:
+ src: sshd_config
+ dest: /etc/ssh/sshd_config
+ owner: root
+ group: root
+ mode: '644'
+ register: sshd_config
+
+- name: Restart sshd
+ become: true
+ ansible.builtin.systemd_service:
+ name: sshd
+ state: restarted
+ when: sshd_config.changed