--- - name: 确保目标目录存在 win_file: path: C:\tmp state: directory - name: 复制安装包(控制机→目标机) win_copy: src: "{{ msi_source }}" dest: "{{ msi_dest }}" when: not ansible_check_mode - name: 安装 VNC Server win_package: path: "{{ msi_dest }}" arguments: "{{ vnc_install_args }}" product_id: "{E2908AB8-056B-461B-962C-F4C2FEC5A404}" state: present register: install_result become: yes become_method: runas become_user: SYSTEM - name: 显示安装结果 debug: var: install_result