You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expect that the reservation be updated (which it does), have the code not crash and have a before and after output of what changed. In this example the Mac address is the only thing that changed.
ACTUAL RESULTS
"exception": "Failed to get lease information for ClientId f4-39-09-09-2b-1f from DHCP server someserver.\r\nAt line:336 char:32\r\n+ ... servation = Get-DhcpServerv4Lease -ClientId $current_lease.ClientId - ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : InvalidType: (f4-39-09-09-2b-1f:root/Microsoft/...cpServerv4Lease) [Get-DhcpServerv4Lease], CimException\r\n + FullyQualifiedErrorId : DHCP 20016,Get-DhcpServerv4Lease\r\n\r\nScriptStackTrace:\r\n\r\n",
"msg": "Unhandled exception while executing module: Failed to get lease information for ClientId f4-39-09-09-2b-1f from DHCP server someserver.",
"_ansible_no_log": false,
"changed": false,
"_ansible_delegated_vars": {
"ansible_host": "someserver",
"ansible_port": 5985,
"ansible_user": "{{ WIN_USERNAME }}",
"ansible_connection": "winrm"
}
}
The text was updated successfully, but these errors were encountered:
Confirmed
Can't find devel. Currently running 1.12.0
SUMMARY
When you attempt to change the mac of an existing reservation, the reservation does get updated but the code crashes right after.
ISSUE TYPE
COMPONENT NAME
https://docs.ansible.com/ansible/latest/collections/community/windows/win_dhcp_lease_module.html
specifically https://github.com/ansible-collections/community.windows/blob/main/plugins/modules/win_dhcp_lease.ps1
lines 336
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
Create a DHCP reservation just like on the example.
community.windows.win_dhcp_lease:
type: reservation
ip: 192.168.100.205
scope_id: 192.168.100.0
mac: 00:B1:8A:D1:5A:1F
dns_hostname: "{{ ansible_inventory }}"
description: Testing Server
Now change the mac and run code again. You should see the reservation update in the DHCP mmc but it should crash at line 336
community.windows.win_dhcp_lease:
type: reservation
ip: 192.168.100.205
scope_id: 192.168.100.0
mac: 00:B1:8A:D1:5A:1a
dns_hostname: "{{ ansible_inventory }}"
description: Testing Server
EXPECTED RESULTS
Expect that the reservation be updated (which it does), have the code not crash and have a before and after output of what changed. In this example the Mac address is the only thing that changed.
ACTUAL RESULTS
"exception": "Failed to get lease information for ClientId f4-39-09-09-2b-1f from DHCP server someserver.\r\nAt line:336 char:32\r\n+ ... servation = Get-DhcpServerv4Lease -ClientId $current_lease.ClientId - ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : InvalidType: (f4-39-09-09-2b-1f:root/Microsoft/...cpServerv4Lease) [Get-DhcpServerv4Lease], CimException\r\n + FullyQualifiedErrorId : DHCP 20016,Get-DhcpServerv4Lease\r\n\r\nScriptStackTrace:\r\n\r\n",
"msg": "Unhandled exception while executing module: Failed to get lease information for ClientId f4-39-09-09-2b-1f from DHCP server someserver.",
"_ansible_no_log": false,
"changed": false,
"_ansible_delegated_vars": {
"ansible_host": "someserver",
"ansible_port": 5985,
"ansible_user": "{{ WIN_USERNAME }}",
"ansible_connection": "winrm"
}
}
The text was updated successfully, but these errors were encountered: