From e9e609e89ad879e10e58f2c4fcfa572f60d6dfad Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Wed, 10 Sep 2025 17:52:58 +0200 Subject: 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. --- roles/ssh/handlers/main.yml | 4 ++-- roles/ssh/meta/main.yml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'roles/ssh') 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" -- cgit v1.2.3