# Need help with win package module

**URL:** <https://forum.ansible.com/t/need-help-with-win-package-module/3476>\
**Category:** Get Help\
**Tags:** windows, collections, zabbix\
**Created:** [January 25, 2024, 3:17pm UTC](https://forum.ansible.com/t/need-help-with-win-package-module/3476 "2024-01-25T15:17:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebsot](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@sebsot](https://forum.ansible.com/u/sebsot)\
**Post date:** [January 25, 2024, 3:17pm UTC](https://forum.ansible.com/t/need-help-with-win-package-module/3476/1 "2024-01-25T15:17:52Z")

</div>

Hi guys, im currently having trouble with installing a zabbix agent using the win\_package module. Im trying to install it in a windows server and i get problems while doing it. The problem is once i run the playbook it freezes and won’t install anything. I’ll provide you the code im using . I want to install it in quiet mode, and pass some arguments that the msi installer needs in order to install correctly.

- name: Zabbix  
hosts: test  
tasks:
  - name: Install Zabbix 6.0.25  
win\_package:  
path: C:\path\to\zabbix\msi\installer.msi  
arguments:
    - /qn
    - LOGTYPE=file
    - LOGFILE=“C:/Zabbix/za.log”
    - SERVER=“servername”
    - LISTENPORT=10050
    - SERVERACTIVE=::1
    - HOSTNAME=localhost
    - TLSCONNECT=psk
    - TLSACCEPT=psk
    - TLSPSKIDENTITY=“identityname”
    - TLSPSKVALUE=“valuename”
    - TLSPSKFILE=“C:/Path/to/psk/key”
    - ENABLEPATH=1
    - INSTALLFOLDER=“C:/Zabbix/”

I’m currently using ansible 2.7.7 and 3.7.3 python version.

The documentation im using to install it is:

[Ansible win package module](https://docs.ansible.com/ansible/2.9/modules/win_package_module.html)

[Zabbix msi installer documentation](https://www.zabbix.com/documentation/6.0/en/manual/installation/install_from_packages/win_msi)

Would really apreciate the help 🙂  
Bye and thanks

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [January 26, 2024, 5:09pm UTC](https://forum.ansible.com/t/need-help-with-win-package-module/3476/2 "2024-01-26T17:09:36Z")

</div>

I’m not a Windows guy, but the [win\_package](https://docs.ansible.com/ansible/2.9/modules/win_package_module.html) doc you cite clearly states:

> If the package is an MSI do not supply the `/qn`, `/log` or `/norestart` arguments.

Try it without `/qn` and let us know if that helped.

---

<div class="post-metadata">

**Author:** ![sebsot](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@sebsot](https://forum.ansible.com/u/sebsot)\
**Post date:** [January 26, 2024, 6:31pm UTC](https://forum.ansible.com/t/need-help-with-win-package-module/3476/3 "2024-01-26T18:31:25Z")

</div>

Hi, i’ve tried it and it keeps frozen while running the task. Do you know how can i see like a log or something about what’s the playbook doing?

Also, i’m not sure if i’m using the win package correctly

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [January 26, 2024, 6:56pm UTC](https://forum.ansible.com/t/need-help-with-win-package-module/3476/4 "2024-01-26T18:56:41Z")

</div>

As long as we’re grasping at straws, let’s speculate that the reason they say not to use the `/log` option is so that the `win_package` module can monitor the output. If that’s true (and we’re already on thin ice, but let’s keep going), and if the Zabbix-specific options `LOGTYPE=file` and `LOGFILE="C:/Zabbix/za.log"` combine to have the same debilitating affect on the `win_package` module that `/log` has, then perhaps `win_package` is hanging because it’s waiting for output on whatever the Windows equivalent of `stdout` is but that’s instead being sent to `C:\Zabbix\za.log`, so it sits around apparently hanging until timeouts expire or an admin pulls the plug.

Try it without `/qn`, `LOGTYPE`, and `LOGFILE`. And if that still doesn’t work, I’m truly out of ideas.

---

<div class="post-metadata">

**Author:** ![sebsot](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@sebsot](https://forum.ansible.com/u/sebsot)\
**Post date:** [January 29, 2024, 1:26pm UTC](https://forum.ansible.com/t/need-help-with-win-package-module/3476/5 "2024-01-29T13:26:01Z")

</div>

I could resolve it, it was a problem with the syntax of the installer. I tried installing manually on Windows and it threw me the typical error window, and when i fixed it, it ended up working on ansible. Thanks ! 😃

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [January 29, 2024, 2:12pm UTC](https://forum.ansible.com/t/need-help-with-win-package-module/3476/6 "2024-01-29T14:12:37Z")

</div>

That’s great! Glad you got it working.

Can I ask, what specifically did you need to change in your Ansible task to get it to chooch?

---

<div class="post-metadata">

**Author:** ![sebsot](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@sebsot](https://forum.ansible.com/u/sebsot)\
**Post date:** [January 29, 2024, 2:21pm UTC](https://forum.ansible.com/t/need-help-with-win-package-module/3476/7 "2024-01-29T14:21:09Z")

</div>

The main problem was not using the “” when giving the additional parameters.  
So instead of how it was written up on the post, it should be

KEY=“value”

I also removed some Properties Keys that weren’t useful while installing them, such as Logfile or HOSTNAME.  
and at last, i added a \>- next to the arguments: (i took this from the ansible doc)  
You can also check if it works just by trying to install it by command line and passing the parameters. And as you said, i didn’t need to give the /qn parameter.

so it should go like this:

- name: Zabbix  
hosts: test  
tasks:
  - name: Install Zabbix 6.0.25  
win\_package:  
path: C:\path\to\zabbix\msi\installer.msi  
arguments: \>-
    - LOGFILE=“C:/Zabbix/za.log”
    - SERVER=“servername”
    - LISTENPORT=“10050”
    - SERVERACTIVE=“servername”
    - TLSCONNECT=“psk”
    - TLSACCEPT=“psk”
    - TLSPSKIDENTITY=“identityname”
    - TLSPSKVALUE=“valuename”
    - TLSPSKFILE=“C:/Path/to/psk/key”
    - ENABLEPATH=1
    - INSTALLFOLDER=“C:/Zabbix/”

I should still try some other options like using / or \ with the paths or some other things, but with this configuration it worked !
