I should add that we've been using this in various playbooks for a while now. It mysteriously stopped working some time between the 9th of August and the 21st of September. Although, that is quite dependant on when our ansible build process ran and picked up new dependency versions.
Cheers Chris On Monday, 4 October 2021 at 14:15:55 UTC+1 Chris Nicel wrote: > Howdy, > > I am also seeing this issue. > > chris:~/git/ansible$ ansible -m community.windows.win_dns_record -a > "type=CNAME computer_name='dc1.example.local' name=myapp zone=' > internal.example.co.uk' ttl=60 value='docker1.example.local'" -i > inventory/test.yml admgmthost -vvv > ansible [core 2.11.5] > config file = /home/chris/git/ansible/ansible.cfg > configured module search path = ['/home/chris/.ansible/plugins/modules', > '/usr/share/ansible/plugins/modules'] > ansible python module location = > /home/chris/git/.venv/lib/python3.8/site-packages/ansible > ansible collection location = /home/chris/git/ansible/installed_collections > executable location = /home/chris/git/.venv/bin/ansible > python version = 3.8.10 (default, Jun 2 2021, 10:49:15) [GCC 9.4.0] > jinja version = 3.0.1 > libyaml = True > Using /home/chris/git/ansible/ansible.cfg as config file > host_list declined parsing /home/chris/git/ansible/inventory/test.yml as > it did not pass its verify_file() method > script declined parsing /home/chris/git/ansible/inventory/test.yml as it > did not pass its verify_file() method > Parsed /home/chris/git/ansible/inventory/test.yml inventory source with > yaml plugin > Skipping callback 'default', as we already have a stdout callback. > Skipping callback 'minimal', as we already have a stdout callback. > Skipping callback 'oneline', as we already have a stdout callback. > META: ran handlers > Using module file > /home/chris/git/.venv/lib/python3.8/site-packages/ansible_collections/community/windows/plugins/modules/win_dns_record.ps1 > Pipelining is enabled. > <admgmthost.example.local> ESTABLISH WINRM CONNECTION FOR USER: > example\service.ansible on PORT 5985 TO admgmthost.example.local > EXEC (via pipeline wrapper) > The full traceback is: > Failed to get the zone information for internal.example.co.uk on server > admgmthost. > At line:73 char:12 > + $records = Get-DnsServerResourceRecord -ZoneName $zone -Name $name -R ... > + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > + CategoryInfo : NotSpecified: > (internal.example.co.uk: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 internal.example.co.uk on server admgmthost. > at > Microsoft.Management.Infrastructure.Internal.Operations.CimAsyncObserverProxyBase`1.ProcessNativeCallback(OperationCallbackProcessingContext > > callbackProcessingContext, T currentItem, Boolean moreResults, MiResult > operationResult, String errorMessage, InstanceHandle errorDetailsHandle) > admgmthost | FAILED! => { > "changed": false, > "msg": "Unhandled exception while executing module: Failed to get the zone > information for internal.example.co.uk on server admgmthost." > } > > I have verified that the ps1 file looks correct located at: > /home/chris/git/.venv/lib/python3.8/site-packages/ansible_collections/community/windows/plugins/modules/win_dns_record.ps1 > > (It appears to have the changes in the above-mentioned PR: > https://github.com/ansible-collections/community.windows/pull/277) > > Installed 1.7.0 of the ansible.windows collection. > > Re-created the Get-DNSServerResourceRecord command used here and ran on a > windows machine via winrm to the same admgmthost server with no issue. Also > ran find on the host machine logged in as the service.ansible user. > Interestingly, if I omit the -ComputerName switch in the powershell > replicas I get the same response. However, it appears as though the > variables are being set correctly in the win_dns_record.ps1 file... unless > I missed something :) > > Any thoughts? > > Cheers > > Chris > On Wednesday, 15 September 2021 at 14:00:02 UTC+1 jesse...@gmail.com > wrote: > >> Welp, time to integrate that myself. >> >> Thanks for the assist Matt. >> >> On Tuesday, September 14, 2021 at 11:40:01 AM UTC-4 Matt Martz wrote: >> >>> That issue appears to have been fixed in the collection, but the >>> change has not been included in a release yet: >>> >>> https://github.com/ansible-collections/community.windows/pull/277 >>> >>> On Tue, Sep 14, 2021 at 10:24 AM jesse...@gmail.com <jesse...@gmail.com> >>> wrote: >>> >>>> Alrighty >>>> >>>> So I'm behind the curve and am updating all of my collections and >>>> testing out playbooks here and there, and I noticed along the way that >>>> from >>>> between community.windows 1.1.0 to 1.6.0 that there has been a major >>>> change >>>> to how this module is handling computer_name: >>>> >>>> Namely, right before I updated it, I tested the playbook and it ran >>>> without incident. >>>> immediately after, I ran it, and failures abound. >>>> >>>> >>>> Using module file >>>> /root/.ansible/collections/ansible_collections/community/windows/plugins/modules/win_dns_record.ps1 >>>> Pipelining is enabled. >>>> < Windows_ansible_host.DOMAIN.net > ESTABLISH WINRM CONNECTION FOR >>>> USER: sa_redact...@domain.net on PORT 5986 TO >>>> l1pnchwmgt12.columbuschildrens.net >>>> EXEC (via pipeline wrapper) >>>> ok: [Windows_ansible_host.DOMAIN.net] => { >>>> "changed": false, >>>> "invocation": { >>>> "module_args": { >>>> "computer_name": "DNSserverredacted.DOMAIN.net", >>>> "name": "deleteme", >>>> "port": null, >>>> "priority": null, >>>> "state": "present", >>>> "ttl": 3600, >>>> "type": "A", >>>> "value": [ >>>> "10.60.24.121" >>>> ], >>>> "weight": null, >>>> "zone": "DOMAIN.net" >>>> } >>>> } >>>> } >>>> >>>> The above are the results for what worked in 1.1.0. >>>> >>>> Immediately after update, it appears that the Computer_name: field is >>>> being entirely ignored and this module is trying to process the request >>>> locally, seeing as my ansible node isn't a DNS server, domain controller, >>>> or anything special, its failing every time with a complete inability to >>>> find the DNS Zone, duh. >>>> >>>> The full traceback is: >>>> Failed to get the zone information for DOMAIN.net on server >>>> Windows_ansible_host. >>>> At line:73 char:12 >>>> + $records = Get-DnsServerResourceRecord -ZoneName $zone -Name $name -R >>>> ... >>>> + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> + CategoryInfo : NotSpecified: >>>> (columbuschildrens.net:root/Microsoft/...rResourceRecord) >>>> [Get-DnsServerResourceRecord], CimException >>>> + FullyQualifiedErrorId : WIN32 1722,Get-DnsServerResourceRecord >>>> >>>> ScriptStackTrace: >>>> at Get-DnsServerResourceRecord<End>, <No file>: line 3130 >>>> at <ScriptBlock>, <No file>: line 73 >>>> >>>> Microsoft.Management.Infrastructure.CimException: Failed to get the >>>> zone information for DOMAIN.net on server Windows_ansible_host.DOMAIN. >>>> >>>> Am I mishandling something here? >>>> I've attempted FQDN, NetBios name and IP addr for computer_name, and >>>> nothing is successful. >>>> it is a VERY simplistic playbook for simply testing the module that it >>>> will work. >>>> I can post it if necessary. >>>> >>>> Thanks >>>> Jess >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Ansible Project" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to ansible-proje...@googlegroups.com. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/ansible-project/2cc179e8-a9ab-4d5c-9735-c18194b04180n%40googlegroups.com >>>> >>>> <https://groups.google.com/d/msgid/ansible-project/2cc179e8-a9ab-4d5c-9735-c18194b04180n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> >>> >>> -- >>> Matt Martz >>> @sivel >>> sivel.net >>> >> -- This e-mail communication and any attachments are confidential and for the sole use of the intended recipient(s). Any review, reliance, dissemination, distribution, copying or other use is strictly prohibited and may be illegal. Any opinions expressed in this communication are personal and are not attributable to Atom Supplies Limited or any of its affiliated or parent companies. The reliability of this method of communication cannot be guaranteed. It can be intercepted, corrupted, delayed, may arrive incomplete, contain viruses or be affected by other interference. We have taken reasonable steps to reduce risks against viruses but cannot accept liability for any damages sustained as a result of this transmission. *If you are not the intended recipient please delete this e-mail and notify the sender immediately by replying to this e-mail.* Atom Group, Atom Brands, Master of Malt and Maverick Drinks are trading names of Atom Supplies Limited. Registered office: Unit 1, Ton Business Park, 2 -8 Morley Road, Tonbridge, Kent, TN9 1RA. Registered in England & Wales. Company number 3193057. VAT number GB 662241553. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7818fd9a-6989-4363-9df4-32500e6bbb75n%40googlegroups.com.