ansible.snmp
ansible.snmp copied to clipboard
Fix windows registry editing task
The windows registry edits were failing:
" "msg": "failed to create registry key at HKLM:\\SYSTEM\\CurrentControlSet\\Services\\SNMP\\Parameters\\ValidCommunities: Exception calling "CreateSubKey" with "1" argument(s): "The specified path is invalid.\r\n"", " Removing the excess backslashes resolves the issue:
{ "ansible_loop_var": "item", "_ansible_no_log": false, "data_type_changed": false, "data_changed": true, "item": { "path": "PermittedManagers", "type": "string", "name": "1", "data": "0.0.0.0" }, "changed": true, "_ansible_item_label": { "path": "PermittedManagers", "type": "string", "name": "1", "data": "0.0.0.0" } }
I've tested this change and it works fine on a Windows server 2019