diff --git a/changelogs/fragments/2614-influxdb_user-fix-issue-introduced-in-PR#2499.yml b/changelogs/fragments/2614-influxdb_user-fix-issue-introduced-in-PR#2499.yml new file mode 100644 index 0000000000..dfae3f2bdf --- /dev/null +++ b/changelogs/fragments/2614-influxdb_user-fix-issue-introduced-in-PR#2499.yml @@ -0,0 +1,2 @@ +bugfixes: + - influxdb_user - fix bug which removed current privileges instead of appending them to existing ones (https://github.com/ansible-collections/community.general/issues/2609, https://github.com/ansible-collections/community.general/pull/2614). diff --git a/plugins/modules/database/influxdb/influxdb_user.py b/plugins/modules/database/influxdb/influxdb_user.py index d9e6b58051..cb35ea7ce6 100644 --- a/plugins/modules/database/influxdb/influxdb_user.py +++ b/plugins/modules/database/influxdb/influxdb_user.py @@ -174,7 +174,7 @@ def set_user_grants(module, client, user_name, grants): if v['privilege'] != 'NO PRIVILEGES': if v['privilege'] == 'ALL PRIVILEGES': v['privilege'] = 'ALL' - parsed_grants.add(v) + parsed_grants.append(v) # check if the current grants are included in the desired ones for current_grant in parsed_grants: