mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
postgresql_user: fix docstrings
Change documentation of "state" param to refer to user (role) state instead of database state. Change 2 function docstrings to reflect the code
This commit is contained in:
parent
1ad61b3e19
commit
8456cb8e52
1 changed files with 3 additions and 3 deletions
|
@ -86,7 +86,7 @@ options:
|
||||||
"[NO]INHERIT", "[NO]LOGIN", "[NO]REPLICATION" ]
|
"[NO]INHERIT", "[NO]LOGIN", "[NO]REPLICATION" ]
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- The database state
|
- The user (role) state
|
||||||
required: false
|
required: false
|
||||||
default: present
|
default: present
|
||||||
choices: [ "present", "absent" ]
|
choices: [ "present", "absent" ]
|
||||||
|
@ -141,13 +141,13 @@ def user_exists(cursor, user):
|
||||||
|
|
||||||
|
|
||||||
def user_add(cursor, user, password, role_attr_flags):
|
def user_add(cursor, user, password, role_attr_flags):
|
||||||
"""Create a new user with write access to the database"""
|
"""Create a new database user (role)."""
|
||||||
query = "CREATE USER \"%(user)s\" with PASSWORD '%(password)s' %(role_attr_flags)s"
|
query = "CREATE USER \"%(user)s\" with PASSWORD '%(password)s' %(role_attr_flags)s"
|
||||||
cursor.execute(query % {"user": user, "password": password, "role_attr_flags": role_attr_flags})
|
cursor.execute(query % {"user": user, "password": password, "role_attr_flags": role_attr_flags})
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def user_alter(cursor, user, password, role_attr_flags):
|
def user_alter(cursor, user, password, role_attr_flags):
|
||||||
"""Change user password"""
|
"""Change user password and/or attributes. Return True if changed, False otherwise."""
|
||||||
changed = False
|
changed = False
|
||||||
|
|
||||||
if user == 'PUBLIC':
|
if user == 'PUBLIC':
|
||||||
|
|
Loading…
Reference in a new issue