Skip to content

Commit 4b1ebc6

Browse files
committed
Add optional gid attribute
1 parent db443a2 commit 4b1ebc6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ The following attributes are required for each user:
2828
* name - The full name of the user (gecos field)
2929
* uid - The numeric user id for the user. This is required for uid consistency
3030
across systems.
31+
* gid - The numeric group id for the group (optional). Otherwise, the
32+
uid will be used
3133
* password - If a hash is provided then that will be used, but otherwise the
3234
account will be locked
3335
* groups - a list of supplementary groups for the user.

tasks/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
tags: ['users','groups','configuration']
66

77
- name: Per-user group creation
8-
group: name="{{item.username}}" gid="{{item.uid}}"
8+
group: name="{{item.username}}"
9+
gid="{{item.gid if item.gid is defined else item.uid}}"
910
with_items: users
1011
when: users_create_per_user_group
1112
tags: ['users','configuration']

0 commit comments

Comments
 (0)