Powershell 使用win_软件包(和其他多种方法)的Ansible playbook不会删除所有文件

Powershell 使用win_软件包(和其他多种方法)的Ansible playbook不会删除所有文件,powershell,ansible,command-line-interface,winrm,credssp,Powershell,Ansible,Command Line Interface,Winrm,Credssp,运行时,我得到一个返回码,表示它已更改,但当我转到主机上的文件夹时,我只看到配置文件夹,实际的uninstall.exe已消失,似乎所有其他内容都保留了下来。如果我手动登录到主机,只需使用/S silent参数执行uninstall.exe位置的命令行,它就会很好地清除所有内容。在这个剧本中,我还有其他任务要安装相同的软件,它们都可以正常工作。感觉像是权限问题或什么东西被阻止了 注意:我是一名测试人员,不是一名开发人员,因此我很乐意回答任何其他问题,但我可能无法立即知道答案 谢谢你的帮助 如果您

运行时,我得到一个返回码,表示它已更改,但当我转到主机上的文件夹时,我只看到配置文件夹,实际的uninstall.exe已消失,似乎所有其他内容都保留了下来。如果我手动登录到主机,只需使用/S silent参数执行uninstall.exe位置的命令行,它就会很好地清除所有内容。在这个剧本中,我还有其他任务要安装相同的软件,它们都可以正常工作。感觉像是权限问题或什么东西被阻止了

注意:我是一名测试人员,不是一名开发人员,因此我很乐意回答任何其他问题,但我可能无法立即知道答案

谢谢你的帮助

如果您怀疑“权限问题或某些内容正在被阻止”,您可以使用或详细模式(
-v
-verbose
-vvv
)来获得更好的洞察力。
# vars file for Installer
ansible_connection: winrm
ansible_user: "{{ AnsibleUser }}"
ansible_password: "{{ AnsiblePassword }}"
ansible_winrm_server_cert_validation: ignore
ansible_winrm_transport: credssp
domain: "{{ domain }}"
ansible_become: true 
ansible_become_method: runas
ansible_become_user: username@domain
ansible_become_password: "{{ AnsiblePassword }}"

#tasks
- name: Uninstall application
  win_package: 
    path: C:\Program Files\application\uninstall.exe
    product_id: "productID"
    arguments: /S
    state: absent
  when: Uninstall == "Uninstall"