summaryrefslogtreecommitdiffstats
path: root/roles/user/tasks
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/user/tasks
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/user/tasks')
-rw-r--r--roles/user/tasks/main.yml24
1 files changed, 1 insertions, 23 deletions
diff --git a/roles/user/tasks/main.yml b/roles/user/tasks/main.yml
index e6e2a306..8fcb101b 100644
--- a/roles/user/tasks/main.yml
+++ b/roles/user/tasks/main.yml
@@ -1,29 +1,7 @@
---
-- name: "Ensure sudo is installed"
- become: true
- ansible.builtin.package:
- name:
- - "sudo"
- state: "present"
-
-- name: "Set sudo group fact"
- ansible.builtin.set_fact:
- # noqa var-naming[no-role-prefix] the sudo group is global and better named this way than user_sudo_group
- sudo_group: "sudo"
-
- name: "Set user groups fact"
ansible.builtin.set_fact:
- user_groups: "{{ ([username, sudo_group] + user_groups) | unique }}"
-
-- name: "Configure permissions for group: {{ sudo_group }}"
- become: true
- community.general.sudoers:
- name: "enable-sudo-group"
- group: "{{ sudo_group }}"
- commands: "ALL"
- nopassword: false
- sudoers_path: "/etc/sudoers.d"
- state: present
+ user_groups: "{{ ([username, 'sudo'] + user_groups) | unique }}"
- name: "Ensure user groups are created"
become: true