-
Notifications
You must be signed in to change notification settings - Fork 93
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_user applying changes in check mode #117
Comments
@elmanolito hi, thanks for reporting this!
Correct? |
@Andersson007 yes, that is correct. |
So I failed to reproduce it. Any ideas from anyone why this can happen? |
Thank you so far for looking into it. We now also tried with another team-member with the same outcome.
|
@elmanolito thanks for checking!
Thank you |
I also have the same issue. Based on my test and in my situation, it happened to any pgsql user whose privilege is set to a value other than ALL. For example, in my case, the pg user which keeps reporting changed state is the one with privilege = pg_stat_database:SELECT. my ENV: |
@zyitingftnt hi, thanks for the feedback! Sorry for the late response, was afk throughout last week. Could you please:
As we can see @elmanolito doesn't pass any I'd be happy to reproduce this in integration tests but failed to do it using @elmanolito 's task. |
@Andersson007. correct. If I set priv: ALL, then problem goes away. If I set priv to other value other than ALL, then it keeps showing "changed". Here is my playbook
the playbook is calling another task postgresql_manage_user from a role called postgresql, the task file of the role is below:
and the variable is defined in the group_vars as below, the user1 stay idempotent, but not user2. If I change priv to ALL in user2, it resolves the problem.
my ansible version is 2.10.5 |
@zyitingftnt thanks for the feedback! |
Hey, thank you all for the feedback. Unfortunately I didn't have any time to further try anything you suggested as I was also forced to continue with this issue still being around. Good thing it was not a show-stopper and just an inconvenience. I will definitely try and report back. |
Ok, I will raise a bug report then. But for me, this is a critical issue since this breaks the idempotency which is the key principe of Ansible tool. |
postgresql_user module 'priv' parameter is now deprecated and will be removed soon. |
@RealGreenDragon thanks for putting the comment here, I'll add this issue link to the issue, so that we won't forget to close this. Thanks! |
SUMMARY
I am currently creating a playbook to configure a postgresdb running on kubernetes and am facing unwanted behaviour with the dry run of the user provisioning.
ISSUE TYPE
COMPONENT NAME
postgresql_user
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
macOS
11.2.3
Kubernetes
v1.16.3
on Ubuntu20.04.2 LTS
STEPS TO REPRODUCE
--check
flag\du
command to run playbook
ansible-playbook -i inifile.ini yamlfile.yml --vault-password-file .vault.password -vvv --diff --tags "createuser" --check --connection=local
example playbook
EXPECTED RESULTS
I expect the output to be a dry run and no changes to be applied. The users to be provisioned should not be listed when checking with
\du
.ACTUAL RESULTS
Changes are applied and users are provisioned to database.
\du
is showing the provisioned users.The text was updated successfully, but these errors were encountered: