Skip to content
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

postgres_user module: role_attr_flags does nothing when combined with no_password_changes #19835

Closed
wvidana opened this issue Jan 3, 2017 · 10 comments · Fixed by #19834
Closed
Labels
affects_2.1 This issue/PR affects Ansible v2.1 bug This issue/PR relates to a bug. module This issue/PR relates to a module. postgresql PostgreSQL community

Comments

@wvidana
Copy link
Contributor

wvidana commented Jan 3, 2017

From @woqer on June 24, 2016 18:12

ISSUE TYPE
  • Bug Report
COMPONENT NAME

postgresql_user

ANSIBLE VERSION
Ansible 2.1.0.0
OS / ENVIRONMENT

Mac OS X El Capitan, Version 10.11.4
Tested on Docker official postgres container and on Amazon RDS PostgreSQL DB instance

SUMMARY

When running a task with postgres_user module, the option role_attr_flags does not set any role attributes when no_password_change is set to yes

STEPS TO REPRODUCE

Run a task with module postgres_user, set any attribute in role_attr_flags and the option no_password_changes to yes


---
- hosts: localhost

  tasks:
    - name: create user
      postgresql_user:
        name: testing_user
        password: somerandompassword
        state: present
        login_host: your.amazon.url.to.postges.instance
        login_user: yourdefaultpostgresuser
        login_password: yoursecretpasswordforthedefaultuser
    - name: add attributes to user
      postgresql_user:
        name: testing_user
        no_password_changes: yes
        role_attr_flags: CREATEDB
        login_host: your.amazon.url.to.postges.instance
        login_user: yourdefaultpostgresuser
        login_password: yoursecretpasswordforthedefaultuser
EXPECTED RESULTS

The user testing_user should have the CreateDB attribute

ACTUAL RESULTS

No changes made.

PLAY [localhost] ***************************************************************

TASK [setup] *******************************************************************
ok: [localhost]

TASK [create user] *************************************************************
changed: [localhost] => {"changed": true, "user": "test_user"}

TASK [add attributes to user] **************************************************
ok: [localhost] => {"changed": false, "user": "test_user"}

PLAY RECAP *********************************************************************
localhost                  : ok=3    changed=1    unreachable=0    failed=0

Copied from original issue: ansible/ansible-modules-core#4034

@wvidana
Copy link
Contributor Author

wvidana commented Jan 3, 2017

Looking at the source code, there is no else branch on the user_alter function https://github.com/ansible/ansible-modules-core/blob/devel/database/postgresql/postgresql_user.py#L236

@wvidana
Copy link
Contributor Author

wvidana commented Jan 3, 2017

From @ansibot on July 30, 2016 14:26

@ansible, ping. This issue is still waiting on your response.
click here for bot help

@wvidana
Copy link
Contributor Author

wvidana commented Jan 3, 2017

From @ansibot on September 8, 2016 20:8

@ansible, ping. This issue is still waiting on your response.
click here for bot help

@wvidana
Copy link
Contributor Author

wvidana commented Jan 3, 2017

From @ansibot on October 6, 2016 13:59

@ansible, ping. This issue is still waiting on your response.
click here for bot help

@wvidana
Copy link
Contributor Author

wvidana commented Jan 3, 2017

ansible/ansible-modules-core#4038 This PR solves this specific issue, but more features needs to be implemented... I was waiting for a merge before writing more code, but it is taking long.

@wvidana
Copy link
Contributor Author

wvidana commented Jan 3, 2017

From @ansibot on October 22, 2016 8:50

@ansible, ping. This issue is still waiting on your response.
click here for bot help

@wvidana
Copy link
Contributor Author

wvidana commented Jan 3, 2017

From @ansibot on November 6, 2016 9:46

@ansible, ping. This issue is still waiting on your response.
click here for bot help

@wvidana
Copy link
Contributor Author

wvidana commented Jan 3, 2017

From @ansibot on November 22, 2016 9:54

@ansible, ping. This issue is still waiting on your response.
click here for bot help

@wvidana
Copy link
Contributor Author

wvidana commented Jan 3, 2017

From @ansibot on December 9, 2016 19:54

This repository has been locked. All new issues and pull requests should be filed in https://github.com/ansible/ansible

Please read through the repomerge page in the dev guide. The guide contains links to tools which automatically move your issue or pull request to the ansible/ansible repo.

@gundalow
Copy link
Contributor

gundalow commented Jan 4, 2017

Should be looked at along side #18933

@jimi-c jimi-c removed the plugin label Jan 4, 2017
@nitzmahone nitzmahone removed the needs_triage Needs a first human triage before being processed. label Jan 5, 2017
alikins added a commit that referenced this issue Feb 15, 2017
(postgresql_user changing role_attr_flags with no_password_checks
fails)
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@dagwieers dagwieers added the postgresql PostgreSQL community label Jan 28, 2019
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.1 This issue/PR affects Ansible v2.1 bug This issue/PR relates to a bug. module This issue/PR relates to a module. postgresql PostgreSQL community
Projects
None yet
6 participants