Skip to content

Module ''ceph_add_users_buckets.py" is not idempotent - Simple update could fix it #14

@wissemmimouna

Description

@wissemmimouna

The module lack idempotency as it's important for ansible , it simply need not to consider existing users/buckets as error .
To do that simply do not raise module.fail_json and instead put change false to the result dict in the main function:

     # conditional state caused a failure
     if result['added_users'] == '' and result['added_buckets'] == '':                                                                 
        #module.fail_json(msg='No users or buckets were added successfully' , **result)
         result['changed'] = False
     # EXIT
    module.exit_json(**result)
 
 if __name__ == '__main__':
     main()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions