community.mongodb icon indicating copy to clipboard operation
community.mongodb copied to clipboard

Create mongodb_role module

Open rhysmeister opened this issue 3 years ago • 2 comments

SUMMARY

A missing module?

https://github.com/ansible-collections/community.mongodb/issues/404

The mongodb_user module can probably provide a good hint on how to start.

https://docs.mongodb.com/manual/reference/command/createRole/

This would be a good first issue for a new contributor. We would also expect integration tests to be written. These could also be based on the int tests for the mongodb_user module.

rhysmeister avatar Oct 13 '21 09:10 rhysmeister

I need to check on a few things but might be able to pick this up as we have a need for this functionality.

yardbirdsax avatar Oct 14 '21 22:10 yardbirdsax

Please do. I'm available for any help required.

Cheers,

Rhys

rhysmeister avatar Oct 15 '21 06:10 rhysmeister

So, its really need thing, because mongo >= 6.0 can't do backup with backup builtin role. We have to create custom role.

superset1 avatar Dec 01 '22 10:12 superset1

Hello @superset1,

Until someone takes it on you can use the mongodb_shell module as a workaround.

Cheers,

Rhys

rhysmeister avatar Dec 01 '22 11:12 rhysmeister

A mongodb_role module has just been merged in https://github.com/ansible-collections/community.mongodb/pull/530

Community feedback would be good before release as this has been thrown together pretty quickly. The goal is not to provide 100% coverage of all role related functionality but rather the common tasks. It's possible to add, remove and update roles. Please check the EXAMPLES block in https://github.com/ansible-collections/community.mongodb/blob/master/plugins/modules/mongodb_role.py or the integration tests https://github.com/ansible-collections/community.mongodb/blob/master/tests/integration/targets/mongodb_role/tasks/main.yml for usage examples

rhysmeister avatar Jan 16 '23 11:01 rhysmeister

Will be in 1.5.0 release

rhysmeister avatar Jan 18 '23 18:01 rhysmeister