Ansible win_xml删除xml元素失败
安装iis后,我正在ansible playbook中运行以下任务,尝试从applicationhost.config中删除默认网站文档文件Ansible win_xml删除xml元素失败,xml,ansible,Xml,Ansible,安装iis后,我正在ansible playbook中运行以下任务,尝试从applicationhost.config中删除默认网站文档文件 - name: Remove defaultDocument Files From applicationhost.config win_xml: path: C:\Windows\System32\inetsrv\Config\applicationHost.config xpath: /configuration/s
- name: Remove defaultDocument Files From applicationhost.config
win_xml:
path: C:\Windows\System32\inetsrv\Config\applicationHost.config
xpath: /configuration/system.webServer/defaultDocument/files/*
state: absent
播放失败,出现以下错误:
The full traceback is:
The property 'removed' cannot be found on this object. Verify that the property exists.
At line:162 char:21
+ ... $result.removed += $result.removed + $removedNode.get_Out ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : PropertyNotFoundStrict
ScriptStackTrace:
at <ScriptBlock>, <No file>: line 162
fatal: [win2019-local-096]: FAILED! => {
"changed": false,
"msg": "Unhandled exception while executing module: The property 'removed' cannot be found on this object. Verify that the property exists."
}
完整的回溯是:
在此对象上找不到属性“已删除”。验证该属性是否存在。
第162行字符:21
+ ... $result.removed+=$result.removed+$removedNode.get\u Out。。。
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+CategoryInfo:NotSpecified:(:)[],ParentContainerRorRecordException
+FullyQualifiedErrorId:PropertyNotFoundStrict
ScriptStackTrace:
在,:第162行
致命:[win2019-local-096]:失败!=>{
“更改”:错误,
“msg”:“执行模块时发生未处理的异常:在此对象上找不到属性”“removed”“。请验证该属性是否存在。”
}
原来这是一个问题,因为我使用debug-vvv运行playbook,以便调试输出。我一不啰嗦地说,它就成功了