# Deploy an exe file to a list of servers

**URL:** <https://forum.ansible.com/t/deploy-an-exe-file-to-a-list-of-servers/36066>\
**Category:** Ansible Project\
**Created:** [December 3, 2021, 3:23pm UTC](https://forum.ansible.com/t/deploy-an-exe-file-to-a-list-of-servers/36066 "2021-12-03T15:23:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nitrous](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@Nitrous](https://forum.ansible.com/u/Nitrous)\
**Post date:** [December 3, 2021, 3:23pm UTC](https://forum.ansible.com/t/deploy-an-exe-file-to-a-list-of-servers/36066/1 "2021-12-03T15:23:18Z")

</div>

I can copy an exe file to the destination server and run it using PS, to install it.

A need has arised where this exe file would need to be copied to a list of 100+ servers and installed.

Can someone show me an example of a playbook yaml file, how we can achieve this?

Thanks

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [December 3, 2021, 4:50pm UTC](https://forum.ansible.com/t/deploy-an-exe-file-to-a-list-of-servers/36066/2 "2021-12-03T16:50:12Z")

</div>

What did you try already?

---

<div class="post-metadata">

**Author:** ![Nitrous](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@Nitrous](https://forum.ansible.com/u/Nitrous)\
**Post date:** [December 3, 2021, 5:12pm UTC](https://forum.ansible.com/t/deploy-an-exe-file-to-a-list-of-servers/36066/3 "2021-12-03T17:12:31Z")

</div>

I am new to ansible, and this is what I tried to run it on 1 server:

- hosts: ‘{{ hostname }}’  
gather\_facts: no  
become\_method: runas  
vars:  
ansible\_become\_password: “{{ domain\_password }}”  
tasks:

- name: Include vars of server.yaml file  
include\_vars:  
file: /etc/ansible/servers/{{ hostname }}.yaml  
name: server

- name: Wait For Connection to Continue  
wait\_for\_connection:  
connect\_timeout: 30

- import\_role:  
name: net481

The above works for 1 server… not sure how I can use the above for multiple servers. Thanks

---

<div class="post-metadata">

**Author:** ![csmart](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/csmart/32/562_2.png) [@csmart](https://forum.ansible.com/u/csmart)\
**Post date:** [December 3, 2021, 9:49pm UTC](https://forum.ansible.com/t/deploy-an-exe-file-to-a-list-of-servers/36066/4 "2021-12-03T21:49:39Z")

</div>

You probably need to create an inventory ([https://docs.ansible.com/ansible/latest/user\_guide/intro\_inventory.html](https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html)) with all of your machines in it, then when you run your playbook you can run it against all of them, or a subset (host or group).  
You can specify custom variables in your inventory at your host level or at a group level, so you don’t need to have a specific include\_vars task if you don’t want to.

For example, I like to use YAML for my inventory ([https://docs.ansible.com/ansible/latest/plugins/inventory/yaml.html](https://docs.ansible.com/ansible/latest/plugins/inventory/yaml.html)), so it might be in a file called inventory.yaml (but you can use /etc/ansible/hosts instead) and look like this:
