matrix-docker-ansible-deploy/roles/matrix-base/tasks/setup_matrix_user.yml
Slavi Pantaleev 8fea6f5130 Make sure matrix_user_uid and matrix_user_gid are always set
If one runs the playbook with `--tags=setup-all`, it would have been
fine.

But running with a specific tag (e.g. `--tags=setup-riot-web`) would
have made that initialization be skipped, and the `matrix-riot-web` role
would fail, due to missing variables.
2020-05-06 09:43:30 +03:00

23 lines
498 B
YAML

---
- name: Ensure Matrix group is created
group:
name: "{{ matrix_user_username }}"
state: present
register: matrix_group
- name: Set Matrix Group GID Variable
set_fact:
matrix_user_gid: "{{ matrix_group.gid }}"
- name: Ensure Matrix user is created
user:
name: "{{ matrix_user_username }}"
state: present
group: "{{ matrix_user_username }}"
register: matrix_user
- name: Set Matrix Group UID Variable
set_fact:
matrix_user_uid: "{{ matrix_user.uid }}"