https://github.com/oefenweb/ansible-user
Ansible role to manage user and group accounts
https://github.com/oefenweb/ansible-user
ansible debian ubuntu user-management users
Last synced: 7 months ago
JSON representation
Ansible role to manage user and group accounts
- Host: GitHub
- URL: https://github.com/oefenweb/ansible-user
- Owner: Oefenweb
- License: mit
- Created: 2015-07-13T14:25:02.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-11-02T11:07:56.000Z (over 2 years ago)
- Last Synced: 2023-11-02T11:37:51.141Z (over 2 years ago)
- Topics: ansible, debian, ubuntu, user-management, users
- Language: Dockerfile
- Size: 96.7 KB
- Stars: 8
- Watchers: 3
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
## user
[](https://github.com/Oefenweb/ansible-user/actions?query=workflow%3ACI)
[](https://galaxy.ansible.com/Oefenweb/user)
Manages user and group accounts.
#### Requirements
None
#### Variables
* `user_groups`: [default: `[]`]: Group declarations
* `user_groups.{n}.name`: [required]: The name of the group to manage
* `user_groups.{n}.gid`: [optional]: GID to set for the group
* `user_groups.{n}.system`: [default: `false`]: If `true`, indicates that the group created is a system group
* `user_groups.{n}.state`: [default: `present`]: Whether the group should be present or not on the remote host
* `user_users`: [default: `[]`]: User declarations
* `user_users.{n}.name`: [required]: The name of the user to manage
* `user_users.{n}.uid`: [optional]: UID to set for the user
* `user_users.{n}.comment`: [default: `''`]: Sets the description (aka `GECOS`) of user account
* `user_users.{n}.group`: [default: `name`]: Sets the user's primary group (takes a group name)
* `user_users.{n}.groups`: [default: `[]`]: Puts the user in this list of groups. When set to `[]`, the user is removed from all groups except the primary group
* `user_users.{n}.append`: [default: `false`]: If `true`, will only add groups, not set them to just the list in groups
* `user_users.{n}.password`: [default: `*`]: Sets the user's password to this crypted value
* `user_users.{n}.update_password`: [default: `always`]: `always` will update passwords if they differ. `on_create` will only set the password for newly created users
* `user_users.{n}.shell`: [default: `/bin/bash`]: Sets the user's shell
* `user_users.{n}.home`: [default: `/home/name` or `/name` for `root`]: Sets the user's home directory
* `user_users.{n}.dir_mode`: [optional]: The mode the home directory (e.g. `0755`, `0700`)
* `user_users.{n}.system`: [default: `false`]: If `true`, indicates that the user created is a system user
* `user_users.{n}.state`: [default: `present`]: Whether the user should be present or not on the remote host
* `user_users.{n}.remove`: [default: `false`]: When used with `state=absent`, behavior is as with `userdel --remove`
## Dependencies
None
#### Example
```yaml
---
- hosts: all
roles:
- oefenweb.user
```
#### License
MIT
#### Author Information
Mischa ter Smitten
#### Feedback, bug-reports, requests, ...
Are [welcome](https://github.com/Oefenweb/ansible-user/issues)!