diff options
| author | Ahmed Abdelhalim <[email protected]> | 2025-12-12 16:23:27 +0100 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2025-12-12 16:23:27 +0100 |
| commit | 1cc253f2da07ca33baf1ba6cac789cdb92923f36 (patch) | |
| tree | 723a8a743f6955d8c1949adec399827e7a0d7356 /roles/user/README.md | |
| parent | d0f7a25781c9aee4c61ba7bf5c7a3f26950f5737 (diff) | |
Update user role to allow configure a password instead of default
If no user_password is provided, the behavior remains the same, it uses
the default changeme password and requires to be changed for using sudo
If a user_password is provided, this hashed password will be used
instead of the default and doesn't require changing on first usage of
sudo
Diffstat (limited to 'roles/user/README.md')
| -rw-r--r-- | roles/user/README.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/roles/user/README.md b/roles/user/README.md index a1c66f12..e3f5360f 100644 --- a/roles/user/README.md +++ b/roles/user/README.md @@ -5,7 +5,8 @@ This role creates the user and configures the `sudo` group for the user ## Role Variables - `username` **Required** name of the user to be created. -- `user_password` created user default password (default: `changeme`). +- `user_default_password` default password (`changeme`) if used required to be changed on first `sudo` usage. +- `user_password` if provided, it will be used instead of the default password (and doesn't require change). - `user_login_shell` the path to default user login shell (default: `/bin/bash`) - `user_public_keys` the list of ssh public keys to be added to user authorized_keys - `user_groups` extra groups to be created and user added to them (default: []) @@ -15,7 +16,8 @@ This role creates the user and configures the `sudo` group for the user - ensure `sudo` installed. - configure `sudoers` file to grant `%sudo ALL=(ALL:ALL) ALL` for `sudo` group. - create user and add to the `username`, `sudo`, extra `user_groups` groups. -- require user password change on first use of `sudo` command. +- if `user_password` is provided, it's used as user password otherwise `user_default_password` is used. +- if `user_default_password` is used, it requires to be changed on first `sudo` usage. - configure the user authorized keys to allow public key authentication (if configured). ### Caveats |
