homeserver/roles/mgrote_rsync/tasks/user.yml
Michael Grote bc7a30f6ce
All checks were successful
ansible-lint / gitleaks (pull_request) Successful in 3s
ansible-lint / Ansible Lint (pull_request) Successful in 28s
ff
2024-10-29 16:56:23 +01:00

25 lines
578 B
YAML

---
- name: Ensure group exists
become: true
ansible.builtin.group:
name: "{{ rsync_mirror_user_group }}"
state: present
- name: Ensure user exists
become: true
ansible.builtin.user:
name: "{{ rsync_mirror_user }}"
groups:
- "{{ rsync_mirror_user_group }}"
- root
create_home: true # für .ssh
append: true
- name: Ensure user is added to sudoers
become: true
community.general.sudoers:
name: "users-sudo-{{ rsync_mirror_user }}"
state: present
user: "{{ rsync_mirror_user }}"
commands: ALL
nopassword: true