From cc2b1e7b6d04947e248ef7596b83d7b77fef3c79 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 30 Mar 2020 15:38:50 +0530 Subject: [PATCH] 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 --- plugins/modules/database/influxdb/influxdb_user.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/modules/database/influxdb/influxdb_user.py b/plugins/modules/database/influxdb/influxdb_user.py index 075a0debd1..6293b156b0 100644 --- a/plugins/modules/database/influxdb/influxdb_user.py +++ b/plugins/modules/database/influxdb/influxdb_user.py @@ -235,10 +235,12 @@ def main(): try: 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 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 except influx.exceptions.InfluxDBClientError as e: module.fail_json(msg=to_native(e))