homeserver/roles/mgrote_rsync/tasks/user.yml

26 lines
578 B
YAML
Raw Normal View History

2024-10-28 18:17:23 +01:00
---
2024-10-28 18:32:18 +01:00
- name: Ensure group exists
2024-10-28 18:17:23 +01:00
become: true
ansible.builtin.group:
2024-10-28 18:27:43 +01:00
name: "{{ rsync_mirror_user_group }}"
2024-10-28 18:17:23 +01:00
state: present
2024-10-28 18:32:18 +01:00
- name: Ensure user exists
2024-10-28 18:17:23 +01:00
become: true
ansible.builtin.user:
2024-10-28 18:27:43 +01:00
name: "{{ rsync_mirror_user }}"
2024-10-29 16:56:23 +01:00
groups:
- "{{ rsync_mirror_user_group }}"
- root
2024-10-28 19:10:09 +01:00
create_home: true # für .ssh
2024-10-29 16:56:23 +01:00
append: true
2024-10-28 18:24:29 +01:00
- name: Ensure user is added to sudoers
become: true
community.general.sudoers:
2024-10-28 18:27:43 +01:00
name: "users-sudo-{{ rsync_mirror_user }}"
2024-10-28 18:24:29 +01:00
state: present
2024-10-28 18:27:43 +01:00
user: "{{ rsync_mirror_user }}"
2024-10-29 15:13:14 +01:00
commands: ALL
2024-10-28 18:24:29 +01:00
nopassword: true