mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00:00
influxdb_user: Don't grant admin privilege in check mode (#26)
influxdb_user module don't change the admin flag for existing user Fixes: ansible/ansible#68139 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
@@ -235,10 +235,12 @@ def main():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
if admin and not user['admin']:
|
if admin and not user['admin']:
|
||||||
client.grant_admin_privileges(user_name)
|
if not module.check_mode:
|
||||||
|
client.grant_admin_privileges(user_name)
|
||||||
changed = True
|
changed = True
|
||||||
elif not admin and user['admin']:
|
elif not admin and user['admin']:
|
||||||
client.revoke_admin_privileges(user_name)
|
if not module.check_mode:
|
||||||
|
client.revoke_admin_privileges(user_name)
|
||||||
changed = True
|
changed = True
|
||||||
except influx.exceptions.InfluxDBClientError as e:
|
except influx.exceptions.InfluxDBClientError as e:
|
||||||
module.fail_json(msg=to_native(e))
|
module.fail_json(msg=to_native(e))
|
||||||
|
|||||||
Reference in New Issue
Block a user