mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-14 13:32:10 +00:00
New group management module
There is a new group management module placed in the plugins folder: plugins/modules/ipagroup.py The group module allows to add, remove, enable, disable, unlock und undelete groups. The group module is as compatible as possible to the Ansible upstream `ipa_group` module, but addtionally offers to add users to a group and also to remove users from a group. Here is the documentation for the module: README-group.md New example playbooks have been added: playbooks/user/add-groups-to-group.yml playbooks/user/add-user-to-group.yml playbooks/user/add-group.yml playbooks/user/delete-group.yml
This commit is contained in:
24
playbooks/user/add-group.yml
Normal file
24
playbooks/user/add-group.yml
Normal file
@@ -0,0 +1,24 @@
|
||||
---
|
||||
- name: Playbook to handle groups
|
||||
hosts: ipaserver
|
||||
become: true
|
||||
|
||||
tasks:
|
||||
# Create group ops with gid 1234
|
||||
- ipagroup:
|
||||
ipaadmin_password: MyPassword123
|
||||
name: ops
|
||||
gidnumber: 1234
|
||||
|
||||
# Create group sysops
|
||||
- ipagroup:
|
||||
ipaadmin_password: MyPassword123
|
||||
name: sysops
|
||||
user:
|
||||
- pinky
|
||||
|
||||
# Create group appops
|
||||
- ipagroup:
|
||||
ipaadmin_password: MyPassword123
|
||||
name: appops
|
||||
|
||||
13
playbooks/user/add-groups-to-group.yml
Normal file
13
playbooks/user/add-groups-to-group.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
- name: Playbook to handle groups
|
||||
hosts: ipaserver
|
||||
become: true
|
||||
|
||||
tasks:
|
||||
# Add group members sysops and appops to group sysops
|
||||
- ipagroup:
|
||||
ipaadmin_password: MyPassword123
|
||||
name: ops
|
||||
group:
|
||||
- sysops
|
||||
- appops
|
||||
13
playbooks/user/add-user-to-group.yml
Normal file
13
playbooks/user/add-user-to-group.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
- name: Playbook to handle groups
|
||||
hosts: ipaserver
|
||||
become: true
|
||||
|
||||
tasks:
|
||||
# Add user member brain to group sysops
|
||||
- ipagroup:
|
||||
ipaadmin_password: MyPassword123
|
||||
name: sysops
|
||||
action: member
|
||||
user:
|
||||
- brain
|
||||
11
playbooks/user/delete-group.yml
Normal file
11
playbooks/user/delete-group.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
- name: Playbook to handle groups
|
||||
hosts: ipaserver
|
||||
become: true
|
||||
|
||||
tasks:
|
||||
# Remove goups sysops, appops and ops
|
||||
- ipagroup:
|
||||
ipaadmin_password: MyPassword123
|
||||
name: sysops,appops,ops
|
||||
state: absent
|
||||
Reference in New Issue
Block a user