community.postgresql
community.postgresql copied to clipboard
postgresql_privs: add support for alter default privileges grant usage on schemas
SUMMARY
Fixes https://github.com/ansible-collections/community.postgresql/issues/332 Fixes https://github.com/ansible-collections/community.postgresql/issues/333
Test task 332 executes the following queries:
ALTER DEFAULT PRIVILEGES REVOKE ALL ON SCHEMAS FROM \"ansible_db_user3\";
ALTER DEFAULT PRIVILEGES GRANT USAGE ON SCHEMAS TO \"ansible_db_user3\"
Test task 333 executes the following:
ALTER DEFAULT PRIVILEGES REVOKE ALL ON TABLES FROM \"ansible_db_user3\"
ALTER DEFAULT PRIVILEGES GRANT SELECT ON TABLES TO \"ansible_db_user3\"
Is it OK?
not-specified is introduced to preserve backwards compatibility, we can change it as a default in a later major release if needed.
ISSUE TYPE
- Bugfix Pull Request
@caseyandgina @hunleyd could you take a look? (if you click the gear in review mode and then click "Hide whitespaces", it'll make the review easier)
if you're OK with the implementation,
@caseyandgina could you please thoroughly test these changes on your test infra? (you can just replace your current module file with the file from my PR)
Despite passing our CI, i won't merge this w/o manual testing (I'm not a DBA).
@hunleyd maybe your folks also could help with testing this?
this looks ok. will test soon
this looks ok. will test soon
@hunleyd thanks, I'll be waiting for your feedback!
@caseyandgina if you take part in testing I asked for in my previous message, it'd be much appreciated as we're touching very important module.
cc @caseyandgina ^
@Andersson007 I'm sorry but I really don't know how to test as I'm not a developer. I'll need some guidance on how to do this. I have been meaning to talk to some colleagues who have more experience with Ansible, but we've been extremely busy at work lately.
@caseyandgina sorry for the late reply, was in a business trip, you can test in simply by:
- finding the location of
plugins/modules/postgresql_privs.pyin yourtestsystem (copy it somewhere) - replacing it with the file from this PR, i.e. with this one
- running the tasks you had issues with before replacing
- after finishing the tests, you can move the original file back
If you have any questions, feel free to ask Thank you
@hunleyd @caseyandgina thanks for reviewing!