Fixed more issues with the delete_group and paramater mismatch
This commit is contained in:
parent
c9d1cc0ce3
commit
ab7678f199
1 changed files with 4 additions and 4 deletions
|
@ -146,7 +146,7 @@ task:
|
||||||
iam_type: user
|
iam_type: user
|
||||||
name: jdavila
|
name: jdavila
|
||||||
state: update
|
state: update
|
||||||
groups: "{{ item.created_group.group_name }}"
|
group: "{{ item.created_group.group_name }}"
|
||||||
with_items: new_groups.results
|
with_items: new_groups.results
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
@ -401,7 +401,7 @@ def create_group(module=None, iam=None, name=None, path=None):
|
||||||
return name, changed
|
return name, changed
|
||||||
|
|
||||||
|
|
||||||
def delete_group(module, iam, name):
|
def delete_group(module=None, iam=None, name=None):
|
||||||
changed = False
|
changed = False
|
||||||
try:
|
try:
|
||||||
iam.delete_group(name)
|
iam.delete_group(name)
|
||||||
|
@ -675,7 +675,7 @@ def main():
|
||||||
group_exists = name in orig_group_list
|
group_exists = name in orig_group_list
|
||||||
|
|
||||||
if state == 'present' and not group_exists:
|
if state == 'present' and not group_exists:
|
||||||
new_group, changed = create_group(iam, name, path)
|
new_group, changed = create_group(iam=iam, name=name, path=path)
|
||||||
module.exit_json(changed=changed, group_name=new_group)
|
module.exit_json(changed=changed, group_name=new_group)
|
||||||
elif state in ['present', 'update'] and group_exists:
|
elif state in ['present', 'update'] and group_exists:
|
||||||
changed, updated_name, updated_path, cur_path = update_group(
|
changed, updated_name, updated_path, cur_path = update_group(
|
||||||
|
@ -703,7 +703,7 @@ def main():
|
||||||
changed=changed, msg="Update Failed. Group %s doesn't seem to exit!" % name)
|
changed=changed, msg="Update Failed. Group %s doesn't seem to exit!" % name)
|
||||||
elif state == 'absent':
|
elif state == 'absent':
|
||||||
if name in orig_group_list:
|
if name in orig_group_list:
|
||||||
removed_group, changed = delete_group(iam, name)
|
removed_group, changed = delete_group(iam=iam, name=name)
|
||||||
module.exit_json(changed=changed, delete_group=removed_group)
|
module.exit_json(changed=changed, delete_group=removed_group)
|
||||||
else:
|
else:
|
||||||
module.exit_json(changed=changed, msg="Group already absent")
|
module.exit_json(changed=changed, msg="Group already absent")
|
||||||
|
|
Loading…
Reference in a new issue