Просмотр исходного кода

Allow matrix_user_uid/matrix_user_gid to be specified manually

pull/572/head
Slavi Pantaleev 5 лет назад
Родитель
Сommit
227f1a28e3
3 измененных файлов: 8 добавлений и 10 удалений
  1. +6
    -0
      roles/matrix-base/defaults/main.yml
  2. +2
    -0
      roles/matrix-base/tasks/setup_matrix_user.yml
  3. +0
    -10
      roles/matrix-base/tasks/validate_config.yml

+ 6
- 0
roles/matrix-base/defaults/main.yml Просмотреть файл

@@ -26,6 +26,12 @@ matrix_federation_public_port: 8448
matrix_user_username: "matrix"
matrix_user_groupname: "matrix"

# By default, the playbook creates the user (`matrix_user_username`)
# and group (`matrix_user_groupname`) with a random id.
# To use a specific user/group id, override these variables.
matrix_user_uid: ~
matrix_user_gid: ~

matrix_base_data_path: "/matrix"
matrix_base_data_path_mode: "750"



+ 2
- 0
roles/matrix-base/tasks/setup_matrix_user.yml Просмотреть файл

@@ -3,6 +3,7 @@
- name: Ensure Matrix group is created
group:
name: "{{ matrix_user_groupname }}"
gid: "{{ omit if matrix_user_gid is none else matrix_user_gid }}"
state: present
register: matrix_group

@@ -13,6 +14,7 @@
- name: Ensure Matrix user is created
user:
name: "{{ matrix_user_username }}"
uid: "{{ omit if matrix_user_uid is none else matrix_user_uid }}"
state: present
group: "{{ matrix_user_groupname }}"
register: matrix_user


+ 0
- 10
roles/matrix-base/tasks/validate_config.yml Просмотреть файл

@@ -1,11 +1 @@
---

- name: (Deprecation) Warn about unused user/group variables
fail:
msg: >
The `{{ item }}` variable defined in your configuration is not used by this playbook anymore.
User/group creation is now dynamic. You can remove these variables from your configuration, as they have no effect on anything.
when: "item in vars"
with_items:
- 'matrix_user_uid'
- 'matrix_user_gid'

Загрузка…
Отмена
Сохранить