Ansible Install MSI in windows

To install an application using the MSI file, we need to use win_get_url to mention the path of the MSI file to download and then use the win_package module to install it. The state present means the MSI will be installed on the machine, and the application is in the present state. It is recommended to download the package first from the URL using the win_get_url module as it opens up more flexibility with what must be set when calling win_package.

# cat MSI.yaml


- name: Installing Apache MSI

hosts: all


- name: Download the Apache installer



dest: C:\app\httpd-2.2.25-win32-x86-no_ssl.msi

- name: Install MSI


path: C:\app\httpd-2.2.25-win32-x86-no_ssl.msi

state: present

Let's run the playbook,

# ansible-playbook -i hosts msi.yml

PLAY [Installing Apache MSI] ********************************************************************************************************************************

TASK [Gathering Facts] **************************************************************************************************************************************

[WARNING]: ERROR DURING WINRM SEND INPUT - attempting to recover: WinRMOperationTimeoutError

ok: []

TASK [Download the Apache installer] ************************************************************************************************************************

changed: []

TASK [Install MSI] ******************************************************************************************************************************************

changed: []

PLAY RECAP ************************************************************************************************************************************************** : ok=3 changed=2 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

Github repo for:

Recent Comments

No comments

Leave a Comment