I want to use this module to create / remove dns records from Microsoft Domain Controllers with integrated DNS. If i use this module on a system where RSAT with DNS is installed - it does not use the param computer_name. We does not directly connect to a DC.
ISSUE TYPE
Bug Report
COMPONENT NAME
community.windows.win_dns_record
ANSIBLE VERSION
ansible [core 2.11.4]
COLLECTION VERSION
1.11
STEPS TO REPRODUCE
Create a user that is allowed to create, delete and modify dns records
Install RSAT on a separate system that could connect to the DC's
Test Get-DNS Get-DnsServerResourceRecord to retriev DNS information
Use the following playbook to automate with ansible
---
- name: Test dns records
hosts: myrsatsystem.my.domain
gather_facts: false
tasks:
- name: Create DNS record
community.windows.win_dns_record:
computer_name: mydc.my.domain
name: "mytest"
type: "A"
value: "192.168.0.1"
zone: "my.domain"
EXPECTED RESULTS
This playbook should be finish successfull.
ACTUAL RESULTS
The full traceback is:
Failed to get the zone information for nat.tc on server myrsatsystem.
At line:73 char:12
+ $records = Get-DnsServerResourceRecord -ZoneName $zone -Name $name -R ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (nat.tc:root/Microsoft/...rResourceRecord) [Get-DnsServerResourceRecord], CimException
+ FullyQualifiedErrorId : WIN32 1722,Get-DnsServerResourceRecord
ScriptStackTrace:
at Get-DnsServerResourceRecord<End>, <No file>: line 4075
at <ScriptBlock>, <No file>: line 73
Microsoft.Management.Infrastructure.CimException: Failed to get the zone information for nat.tc on server myrsatsystem.
at Microsoft.Management.Infrastructure.Internal.Operations.CimAsyncObserverProxyBase`1.ProcessNativeCallback(OperationCallbackProcessingContext callbackProcessingContext, T currentItem, Boolean moreResults, MiResult operationResult, String errorMessage, InstanceHandle errorDetailsHandle)
fatal: [myrsatsystem.my.domain]: FAILED! => {
"changed": false,
"msg": "Unhandled exception while executing module: Failed to get the zone information for nat.tc on server myrsatsystem.my.domain."
}
The given param computer_name is not used there. I can only find an rewrite of the ansible param but nothing happens with this param inside the ps1 file.
SUMMARY
I want to use this module to create / remove dns records from Microsoft Domain Controllers with integrated DNS. If i use this module on a system where RSAT with DNS is installed - it does not use the param computer_name. We does not directly connect to a DC.
ISSUE TYPE
COMPONENT NAME
community.windows.win_dns_record
ANSIBLE VERSION
COLLECTION VERSION
STEPS TO REPRODUCE
EXPECTED RESULTS
This playbook should be finish successfull.
ACTUAL RESULTS
I think the source of my error is located in https://github.com/ansible-collections/community.windows/blob/main/plugins/modules/win_dns_record.ps1 on line 74
The given param computer_name is not used there. I can only find an rewrite of the ansible param but nothing happens with this param inside the ps1 file.