Hi,
I am having some issues using the win_xml module, I am hoping to do a bit more troubleshooting.
I tried to follow some of the instructions of the following link but i wasn’t successful in setting up a debugging environment.
https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general_windows.html#windows-debugging
I have a reasonable amount of experience with powershell, I was hoping to try and debug things in powershell, but couldn’t get myself setup, any help would really be appreciated.
Thanks.
PLAYBOOK
- name: update xml (???Working)
win_xml:
path: “{{dest_instances_content_base_path}}\instance_ver.xml”
path: c:/temp/ls/Instances/Default/instance_ver.xml
xpath: /configuration/runtime/assemblyBinding/dependentAssembly/bindingRedirect
fragment: ‘86.10.8.0’
attribute: newVersion
type: attribute
instance_ver.xml (content)
OUTPUT:
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/windows/win_xml.ps1
Pipelining is enabled.
<WIN-2016AAA.dom.co.nz> ESTABLISH WINRM CONNECTION FOR USER: Administrator@DOM.CO.NZ on PORT 5985 TO WIN-2016AAA.dom.co.nz
EXEC (via pipeline wrapper)
The full traceback is:
You cannot call a method on a null-valued expression.
At line:204 char:5
- [bool]$add = !$node.HasAttribute($attribute) -Or ($node.$attribut …
-
- CategoryInfo : InvalidOperation: ( , ParentContainsErrorRecordException
- FullyQualifiedErrorId : InvokeMethodOnNull
ScriptStackTrace:
at , : line 204
fatal: [WIN-2016AAA.dom.co.nz]: FAILED! => {
“changed”: false,
“msg”: “Unhandled exception while executing module: You cannot call a method on a null-valued expression.”
}