2020-05-06 08:43:30 +02:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Ensure Matrix group is created
|
2022-07-18 09:39:08 +02:00
|
|
|
ansible.builtin.group:
|
2020-05-06 09:01:39 +02:00
|
|
|
name: "{{ matrix_user_groupname }}"
|
2020-07-06 10:05:34 +02:00
|
|
|
gid: "{{ omit if matrix_user_gid is none else matrix_user_gid }}"
|
2020-05-06 08:43:30 +02:00
|
|
|
state: present
|
|
|
|
register: matrix_group
|
|
|
|
|
|
|
|
- name: Ensure Matrix user is created
|
2022-07-18 09:39:08 +02:00
|
|
|
ansible.builtin.user:
|
2020-05-06 08:43:30 +02:00
|
|
|
name: "{{ matrix_user_username }}"
|
2020-07-06 10:05:34 +02:00
|
|
|
uid: "{{ omit if matrix_user_uid is none else matrix_user_uid }}"
|
2020-05-06 08:43:30 +02:00
|
|
|
state: present
|
2020-05-06 09:01:39 +02:00
|
|
|
group: "{{ matrix_user_groupname }}"
|
2020-09-29 17:14:37 +02:00
|
|
|
home: "{{ matrix_base_data_path }}"
|
2022-02-05 21:32:54 +01:00
|
|
|
create_home: false
|
|
|
|
system: true
|
2020-05-06 08:43:30 +02:00
|
|
|
register: matrix_user
|
|
|
|
|
2022-11-23 16:07:52 +01:00
|
|
|
- name: Initialize matrix_user_uid and matrix_user_gid
|
2022-07-18 09:39:08 +02:00
|
|
|
ansible.builtin.set_fact:
|
2020-05-06 08:43:30 +02:00
|
|
|
matrix_user_uid: "{{ matrix_user.uid }}"
|
2022-11-23 16:07:52 +01:00
|
|
|
matrix_user_gid: "{{ matrix_group.gid }}"
|