From 843da0ca2b2ec6a753c341c298d7d486628751f0 Mon Sep 17 00:00:00 2001 From: mar1ad <75585399+mar1ad@users.noreply.github.com> Date: Sun, 5 Jun 2022 10:12:17 +0200 Subject: [PATCH] Allow for user gitea to be added to a list of secondary groups via 'gitea_groups' --- README.md | 3 ++- defaults/main.yml | 1 + tasks/create_user.yml | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 87c7a89..ef90b57 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,8 @@ Either you define exactly which release you install. Or you use the option ``lat ### gitea in the linux world | variable name | default value | description | | ------------- | ------------- | ----------- | -| `gitea_group` | `gitea` | UNIX group used by Gitea | +| `gitea_group` | `gitea` | Primary UNIX group used by Gitea | +| `gitea_groups` | null | Optionally a list of secondary UNIX groups used by Gitea | | `gitea_home` | `/var/lib/gitea` | Base directory to work | | `gitea_shell` | `/bin/false` | UNIX shell used by gitea. Set it to `/bin/bash` if you don't use the gitea built-in ssh server. | | `gitea_systemd_cap_net_bind_service` | `false` | Adds `AmbientCapabilities=CAP_NET_BIND_SERVICE` to systemd service file | diff --git a/defaults/main.yml b/defaults/main.yml index fddfa3e..50a8078 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -11,6 +11,7 @@ submodules_versioncheck: false # gitea in the linux world gitea_group: 'gitea' +# gitea_groups: [] # Optional a list of groups user gitea will be added to gitea_home: '/var/lib/gitea' gitea_shell: '/bin/false' gitea_systemd_cap_net_bind_service: false diff --git a/tasks/create_user.yml b/tasks/create_user.yml index f68fa7c..91bf3d0 100644 --- a/tasks/create_user.yml +++ b/tasks/create_user.yml @@ -16,7 +16,8 @@ ansible.builtin.user: name: "{{ gitea_user }}" comment: "Gitea user" - groups: "{{ gitea_group }}" + group: "{{ gitea_group }}" + groups: "{{ gitea_groups | default(omit) }}" home: "{{ gitea_home }}" shell: "{{ gitea_shell }}" system: true