Backport/2.7/49084 (#49973)
* influxdb_user: Fixed default password behavior (#47040) (cherry picked from commit1eed8900ed
) * Amends #47040 - influxdb_user - Prevents potential accidental password changes to blank (#49084) * Amends #47040 - Prevents potential accidental password changes to blank * Added changelog fragment (cherry picked from commitb422c59ada
)
This commit is contained in:
parent
a9fd20318c
commit
898ec291b0
2 changed files with 5 additions and 1 deletions
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
bugfixes:
|
||||||
|
- influxdb_user - An unspecified password now sets the password to blank, except on existing users. This previously caused an unhandled exception.
|
|
@ -166,11 +166,12 @@ def main():
|
||||||
|
|
||||||
if state == 'present':
|
if state == 'present':
|
||||||
if user:
|
if user:
|
||||||
if check_user_password(module, client, user_name, user_password):
|
if user_password is None or check_user_password(module, client, user_name, user_password):
|
||||||
module.exit_json(changed=False)
|
module.exit_json(changed=False)
|
||||||
else:
|
else:
|
||||||
set_user_password(module, client, user_name, user_password)
|
set_user_password(module, client, user_name, user_password)
|
||||||
else:
|
else:
|
||||||
|
user_password = user_password or ''
|
||||||
create_user(module, client, user_name, user_password, admin)
|
create_user(module, client, user_name, user_password, admin)
|
||||||
|
|
||||||
if state == 'absent':
|
if state == 'absent':
|
||||||
|
|
Loading…
Reference in a new issue