46
46
- Note that if the provided password string is already in MD5-hashed
47
47
format, then it is used as-is, regardless of I(encrypted) option.
48
48
type: str
49
- db :
49
+ login_db :
50
50
description:
51
51
- Name of database to connect to and where user's permissions are granted.
52
52
type: str
53
53
default: ''
54
54
aliases:
55
- - login_db
55
+ - db
56
56
fail_on_user:
57
57
description:
58
58
- If C(true), fails when the user (role) cannot be removed. Otherwise just log and continue.
220
220
# You should use the 'postgresql_privs' module instead.
221
221
- name: Connect to acme database, create django user, and grant access to database and products table
222
222
community.postgresql.postgresql_user:
223
- db : acme
223
+ login_db : acme
224
224
name: django
225
225
password: ceec4eif7ya
226
226
priv: "CONNECT/products:ALL"
227
227
expires: "Jan 31 2020"
228
228
229
229
- name: Add a comment on django user
230
230
community.postgresql.postgresql_user:
231
- db : acme
231
+ login_db : acme
232
232
name: django
233
233
comment: This is a test user
234
234
249
249
# You should use the 'postgresql_privs' module instead.
250
250
- name: Connect to acme database and remove test user privileges from there
251
251
community.postgresql.postgresql_user:
252
- db : acme
252
+ login_db : acme
253
253
name: test
254
254
priv: "ALL/products:ALL"
255
255
state: absent
259
259
# You should use the 'postgresql_privs' module instead.
260
260
- name: Connect to test database, remove test user from cluster
261
261
community.postgresql.postgresql_user:
262
- db : test
262
+ login_db : test
263
263
name: test
264
264
priv: ALL
265
265
state: absent
268
268
# You should use the 'postgresql_privs' module instead.
269
269
- name: Connect to acme database and set user's password with no expire date
270
270
community.postgresql.postgresql_user:
271
- db : acme
271
+ login_db : acme
272
272
name: django
273
273
password: mysupersecretword
274
274
priv: "CONNECT/products:ALL"
279
279
280
280
- name: Connect to test database and remove an existing user's password
281
281
community.postgresql.postgresql_user:
282
- db : test
282
+ login_db : test
283
283
user: test
284
284
password: ""
285
285
@@ -1096,7 +1096,13 @@ def main():
1096
1096
password = dict (type = 'str' , default = None , no_log = True ),
1097
1097
state = dict (type = 'str' , default = 'present' , choices = ['absent' , 'present' ]),
1098
1098
priv = dict (type = 'str' , default = None , removed_in_version = '4.0.0' , removed_from_collection = 'community.postgreql' ),
1099
- db = dict (type = 'str' , default = '' , aliases = ['login_db' ]),
1099
+ login_db = dict (type = 'str' , default = "" , aliases = ['db' ], deprecated_aliases = [
1100
+ {
1101
+ 'name' : 'db' ,
1102
+ 'version' : '4.0.0' ,
1103
+ 'collection_name' : 'community.postgresql' ,
1104
+ }],
1105
+ ),
1100
1106
fail_on_user = dict (type = 'bool' , default = True , aliases = ['fail_on_role' ]),
1101
1107
role_attr_flags = dict (type = 'str' , default = '' ),
1102
1108
encrypted = dict (type = 'bool' , default = True ),
@@ -1119,10 +1125,10 @@ def main():
1119
1125
state = module .params ["state" ]
1120
1126
fail_on_user = module .params ["fail_on_user" ]
1121
1127
# WARNING: privs are deprecated and will be removed in community.postgresql 4.0.0
1122
- if module .params ['db ' ] == '' and module .params ["priv" ] is not None :
1128
+ if module .params ['login_db ' ] == '' and module .params ["priv" ] is not None :
1123
1129
module .fail_json (msg = "privileges require a database to be specified" )
1124
1130
# WARNING: privs are deprecated and will be removed in community.postgresql 4.0.0
1125
- privs = parse_privs (module .params ["priv" ], module .params ["db " ])
1131
+ privs = parse_privs (module .params ["priv" ], module .params ["login_db " ])
1126
1132
no_password_changes = module .params ["no_password_changes" ]
1127
1133
if module .params ["encrypted" ]:
1128
1134
encrypted = "ENCRYPTED"
0 commit comments