Win_package hangs

Hi - I’m trying to use the Ansible win_package module to install “Visual C++ Redistributable Packages for Visual Studio 2013” on a Windows Server 2022 system. The win_package execution does not produce an error, but it hangs.

Here is my task code:

- name: "Install Visual C++ Redistributable Packages for Visual Studio 2013"
    path: c:\temp\vcredist_x64.exe
  become: true
  become_method: runas
  become_user: "administrator"

After seeing the hang behavior initially, I read in Using Ansible and Windows — Ansible Community Documentation the suggestion to use ‘become’ for one issue, so I thought I’d try it for my issue, too. There was no change in behavior

I let it run for over an hour but did not see any output to ansible-playbook (run with -vvv) beyond:

TASK [install-exchange : Install Visual C++ Redistributable Packages for Visual Studio 2013] ******************************************************************
task path: /root/ecdm-ansible/ansible/roles/install-exchange/tasks/main.yml:294
Using module file /root/.ansible/collections/ansible_collections/ansible/windows/plugins/modules/win_package.ps1
Pipelining is enabled.
EXEC (via pipeline wrapper)

Other Ansible modules run earlier in the playbook completed successfully, so I know that the basic authentication and execution machinery is functional.

I’m using:

ansible-galaxy collection list


Collection Version 2.4.0


Collection Version 1.14.0
b57a80c06ac8:~ #

Thoughts, please! Thanks!

In the windows world. you often need parameters to process a silent unattended installation.
And it heavly depend on the installer type

One way to figure it out is to install it once using cmd or powershell to determine th arguments.

For example if you want to install fireox, you need to do

    - name: install firefox
        url_timeout: 120
        path: "{{ VERSION }}/win64/de/Firefox%20Setup%20{{ VERSION }}.exe"
          - -ms
      register: firefox_installation

and for fluent-bit, you’ll do

- name: install fluent-bit
    path: C:\somedir\fluent-bit-{{ FBVERSION }}.exe
    validate_certs: false
    url_timeout: 120
      - /S
      - /D=C:\somedir
    wait_for_children: true

Excellent! Thanks very much for this information. @markuman !