From 7eb99bf024c58eb2a6a4b8fcde0059f805f0952e Mon Sep 17 00:00:00 2001 From: Emerson Rocha Luiz Date: Thu, 23 Jan 2020 06:59:13 -0300 Subject: [PATCH] minio_usergroup_manange option added; Added create_home: no to task Create Minio user --- README.md | 7 +++++-- defaults/main.yml | 1 + tasks/install-server.yml | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 86f4e3b..c151547 100644 --- a/README.md +++ b/README.md @@ -36,10 +36,13 @@ Can be 'RELEASE.2019-06-27T21-13-50Z' for instance. ```yaml minio_user: minio minio_group: minio +minio_usergroup_manage: true ``` -Name and group of the user running the minio server. -**NB**: This role automatically creates the minio user and/or group if these does not exist in the system. +Name and group of the user running the minio server. Without explicitly +disabling `minio_usergroup_manage: false` this role will create/update this +user and group. The created/updated user will be installed/updated as a system +user. ```yaml minio_server_envfile: /etc/default/minio diff --git a/defaults/main.yml b/defaults/main.yml index 60a753f..cc7783f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -11,6 +11,7 @@ minio_client_release: "" # Runtime user and group for the Minio server service minio_user: minio minio_group: minio +minio_usergroup_manage: true # Path to the file containing the ENV variables for the Minio server minio_server_envfile: /etc/default/minio diff --git a/tasks/install-server.yml b/tasks/install-server.yml index 6214efa..eba1052 100644 --- a/tasks/install-server.yml +++ b/tasks/install-server.yml @@ -21,13 +21,16 @@ group: name: "{{ minio_group }}" state: present + when: minio_usergroup_manage|bool - name: Create Minio user user: name: "{{ minio_user }}" group: "{{ minio_group }}" system: "yes" + create_home: no shell: "/usr/sbin/nologin" + when: minio_usergroup_manage|bool - name: Create the Minio data storage directories file: