New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
postgresql_privs: Support FOREIGN DATA WRAPPER and FOREIGN SERVER #38803
postgresql_privs: Support FOREIGN DATA WRAPPER and FOREIGN SERVER #38803
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM, need one more person to take a look.
Thanks. We need one more person to look at this and then we can proceed. |
cc @maveric-tellrv Would you like to review this PR ? |
30977cf
to
f8449cd
Compare
@Andersson007 Hi, conflicts resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM,
a couple of notices:
- Add examples with new types to EXAMPLE block.
use the following example's form, (not as the existing examples):
- name: ....
postgresql_privs:
...
- To be sure that it won't brake down, would be better to add CI tests (for 'foreign_data_wrapper' type only is enough) to a new file like
test/integration/targets/postgresql/tasks/postgresql_privs.yml and include it to main.yml in the same dir.
You can use for example test/integration/targets/postgresql/tasks/postgresql_query.yml from the current dev branch. - Add the note about 2.8 as Akasurde said in April.
3e42652
to
f85b55a
Compare
Thanks for checking it out. I've added integration tests and mentioned changes. |
privs: ALL | ||
objs: dummy | ||
db: "{{ db_name }}" | ||
login_user: "{{ pg_user }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should check here at least that changed == true when we grant these privs
login_user: "{{ pg_user }}" | |
login_user: "{{ pg_user }}" | |
register: result | |
ignore_errors: yes | |
- assert: | |
that: | |
- result.changed == true |
privs: ALL | ||
objs: dummy_server | ||
db: "{{ db_name }}" | ||
login_user: "{{ pg_user }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
login_user: "{{ pg_user }}" | |
login_user: "{{ pg_user }}" | |
register: result | |
ignore_errors: yes | |
- assert: | |
that: | |
- result.changed == true |
I think we should check here at least that changed == true when we grant these privs too because maybe this actually won't return changed == true. We can't be sure if we don't check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, to make your test complete:
- try to grant both privs again and check that changed == false
- try to drop both privs and check that changed == true
- try to drop both privs again and check that changed == false
Also, please, add a changelog fragment https://docs.ansible.com/ansible/devel/community/development_process.html#making-your-pr-merge-worthy |
f85b55a
to
c826d78
Compare
043e8ed
to
6842299
Compare
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shipit
@Akasurde , seems 2 shipits. Ready for merge |
@lichensky , @Akasurde , thank you, good job! |
If you have any questions, you may ask me directly by aaklychkov at mail dot ru |
SUMMARY
This introduces support for
FOREIGN DATA WRAPPER
andFOREIGN SERVER
as object types inpostgresql_privs
module.Issues:
#38801
ISSUE TYPE
COMPONENT NAME
postgresql_privs
ANSIBLE VERSION