mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-06 13:23:14 +00:00
ipagroup: Fail on member addition/removal from not existing group
If members are added to or removed from a not existing group, an error is printed.
This commit is contained in:
@@ -345,6 +345,9 @@ def main():
|
||||
"service": service_del,
|
||||
}])
|
||||
elif action == "member":
|
||||
if res_find is None:
|
||||
ansible_module.fail_json(msg="No group '%s'" % name)
|
||||
|
||||
user_add = list(
|
||||
set(user or []) -
|
||||
set(res_find.get("member_user", [])))
|
||||
@@ -371,6 +374,9 @@ def main():
|
||||
commands.append([name, "group_del", {}])
|
||||
|
||||
elif action == "member":
|
||||
if res_find is None:
|
||||
ansible_module.fail_json(msg="No group '%s'" % name)
|
||||
|
||||
# Remove intersection member
|
||||
user_del = list(
|
||||
set(user or []) &
|
||||
|
||||
Reference in New Issue
Block a user