summaryrefslogtreecommitdiffstats
path: root/roles/ssh
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2025-09-10 17:52:58 +0200
committerAhmed Abdelhalim <[email protected]>2025-09-10 17:52:58 +0200
commite9e609e89ad879e10e58f2c4fcfa572f60d6dfad (patch)
tree6353c98fa1b6ad69c21931ac299e8522f48c645f /roles/ssh
parenta5983fd890fc94650e9cc0b890220931ad3b3a88 (diff)
Refactor role dependencies to be more module modular
This modularity means that each role can be installed in a playbook by itself as long as the other roles exist around it. This also straps the ensure dependency packages exist in any of the roles tasks, they should be moved to their own roles and configured properly if needed.
Diffstat (limited to 'roles/ssh')
-rw-r--r--roles/ssh/handlers/main.yml4
-rw-r--r--roles/ssh/meta/main.yml3
2 files changed, 4 insertions, 3 deletions
diff --git a/roles/ssh/handlers/main.yml b/roles/ssh/handlers/main.yml
index a73aca7e..5fd0d93a 100644
--- a/roles/ssh/handlers/main.yml
+++ b/roles/ssh/handlers/main.yml
@@ -1,13 +1,13 @@
---
- name: "Reload systemd"
become: true
- ansible.builtin.systemd_service:
+ ansible.builtin.systemd:
daemon_reload: true
when: not ansible_is_chroot
- name: "Restart ssh"
become: true
- ansible.builtin.systemd_service:
+ ansible.builtin.systemd:
name: "{{ ssh_service_name }}"
state: "restarted"
when: not ansible_is_chroot
diff --git a/roles/ssh/meta/main.yml b/roles/ssh/meta/main.yml
index bc90a3ab..d04b3eb0 100644
--- a/roles/ssh/meta/main.yml
+++ b/roles/ssh/meta/main.yml
@@ -1,5 +1,6 @@
---
-dependencies: []
+dependencies:
+ - role: systemd
galaxy_info:
author: "a14m"
description: "Configure distro ssh with hardening"