Merge "Add devuser to the specified group(s)"
This commit is contained in:
@@ -13,6 +13,12 @@ DIB_DEV_USER_USERNAME
|
||||
:Default: devuser
|
||||
:Description: Username for the created user.
|
||||
|
||||
DIB_DEV_USER_GROUPS
|
||||
:Required: No
|
||||
:Default: No
|
||||
:Description: Additional groups (comma separated if many) for the created
|
||||
user (groups should already exist).
|
||||
|
||||
DIB_DEV_USER_SHELL
|
||||
:Required: No
|
||||
:Default: System default (The useradd default is used)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
export DIB_DEV_USER_USERNAME=${DIB_DEV_USER_USERNAME:-devuser}
|
||||
export DIB_DEV_USER_GROUPS=${DIB_DEV_USER_GROUPS:-}
|
||||
export DIB_DEV_USER_SHELL=${DIB_DEV_USER_SHELL:-}
|
||||
export DIB_DEV_USER_PWDLESS_SUDO=${DIB_DEV_USER_PWDLESS_SUDO:-}
|
||||
export DIB_DEV_USER_AUTHORIZED_KEYS=${DIB_DEV_USER_AUTHORIZED_KEYS:-}
|
||||
|
||||
@@ -11,6 +11,9 @@ if [ -n "${DIB_DEV_USER_SHELL}" ]; then
|
||||
user_shell_args="-s ${DIB_DEV_USER_SHELL}"
|
||||
fi
|
||||
useradd -m ${DIB_DEV_USER_USERNAME} $user_shell_args
|
||||
if [ -n "${DIB_DEV_USER_GROUPS}" ]; then
|
||||
usermod -a -G ${DIB_DEV_USER_GROUPS} ${DIB_DEV_USER_USERNAME}
|
||||
fi
|
||||
set +x
|
||||
if [ -n "${DIB_DEV_USER_PASSWORD}" ]; then
|
||||
echo "Setting password."
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The newly created devuser now can be added to the specified group(s) with
|
||||
new variable ``DIB_DEV_USER_GROUPS``. Groups should already exist.
|
||||
Reference in New Issue
Block a user