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
commit48e2ad4c1e081b9e6a336132a7f78cb7399c43d9 (patch)
tree6353c98fa1b6ad69c21931ac299e8522f48c645f /roles/ssh
parentdb5127984ff77d0ff78ca37f521cc6b1d6d33423 (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"