A role for managing groups.
- Hosts should be bootstrapped for ansible usage (have python,...)
- Root privileges, eg
become: yes
groupadd
,groupdel
andgroupmod
should be available on the host
Variable | Description | Default value |
---|---|---|
group_list |
List of groups (see details!) | [] |
group_list_host |
List of groups (see details!) | [] |
group_list_group |
List of groups (see details!) | [] |
group_state |
Default group state | present |
group_system |
Default group system state | no |
group_list
, group_list_host
and group_list_group
are merged when
managing the groups. You can use the host and group lists to specify
groups per host or group off hosts.
The group list allows you to define which groups must be managed. Each item in the list can have following attributes:
Variable | Description | Required |
---|---|---|
name |
Group name | yes |
gid |
Group id | no |
state |
Group state | no |
system |
System group? | no |
group_list:
- name: group1
- name: group2
gid: 1001
system: yes
- name: group3
gid: 1002
state: absent
None.
---
- hosts: servers
roles:
- { role: GROG.group
become: yes,
group_list: [
{ name: group1,
state: present },
{ name: group2,
gid: 1001 }
]
}
All assistance, changes or ideas welcome!
By G. Roggemans
MIT