30 lines
747 B
YAML
30 lines
747 B
YAML
---
|
|
- name: ensure group exists
|
|
become: true
|
|
ansible.builtin.group:
|
|
name: "{{ rsync_mirror_user_group }}"
|
|
state: present
|
|
when:
|
|
- rsync_mirror_user_group is defined
|
|
- rsync_mirror_user is defined
|
|
|
|
- name: ensure user exists
|
|
become: true
|
|
ansible.builtin.user:
|
|
name: "{{ rsync_mirror_user }}"
|
|
group: "{{ rsync_mirror_user_group }}"
|
|
create_home: true
|
|
when:
|
|
- rsync_mirror_user_group is defined
|
|
- rsync_mirror_user is defined
|
|
|
|
- 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
|
|
when:
|
|
- rsync_mirror_syncoid_destination_host
|