# Ansible WinRM dont run concurrent process

**URL:** <https://forum.ansible.com/t/ansible-winrm-dont-run-concurrent-process/32082>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [January 29, 2020, 11:31am UTC](https://forum.ansible.com/t/ansible-winrm-dont-run-concurrent-process/32082 "2020-01-29T11:31:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wagfeliz](https://avatars.discourse-cdn.com/v4/letter/w/dbc845/32.png) [@wagfeliz](https://forum.ansible.com/u/wagfeliz)\
**Post date:** [January 29, 2020, 11:31am UTC](https://forum.ansible.com/t/ansible-winrm-dont-run-concurrent-process/32082/1 "2020-01-29T11:31:51Z")

</div>

Hi,

We have 3 playbooks that runs concurrently winrm process on a windows server, I did notice even when I start all of then in the same time, only 1 runs, the others get stuck and wait for the first to finish, then starts.

I did follow all the documentation that I could find and this is my current conf :

PS C:\Windows\system32\> winrm get winrm/config/Winrs  
Winrs  
AllowRemoteShellAccess = true  
IdleTimeout = 7200000  
MaxConcurrentUsers = 10  
MaxShellRunTime = 2147483647  
MaxProcessesPerShell = 25  
MaxMemoryPerShellMB = 1024  
MaxShellsPerUser = 30

All the 3 process runs 3 tasks each on winrm.

Is this an normal behavior ? What can I do to change that ? Should it be able to run in parallel ?

There is any docs someone can point me out about how to setup winrm to allow +2 process to run simultaneously ?

Best Regards,  
Wagner.

---

<div class="post-metadata">

**Author:** ![dmartin](https://avatars.discourse-cdn.com/v4/letter/d/c4cdca/32.png) [@dmartin](https://forum.ansible.com/u/dmartin)\
**Post date:** [January 29, 2020, 5:10pm UTC](https://forum.ansible.com/t/ansible-winrm-dont-run-concurrent-process/32082/2 "2020-01-29T17:10:28Z")

</div>

How are you making them concurrent? IE what does your play look like?

If you have three conventional separate ansible tasks, that won’t work. You’d need a single task that launches all 3 or use async.

[https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_async.html](https://docs.ansible.com/ansible/latest/user_guide/playbooks_async.html)

If you’re already using async, show us your playbook.

---

<div class="post-metadata">

**Author:** ![wagfeliz](https://avatars.discourse-cdn.com/v4/letter/w/dbc845/32.png) [@wagfeliz](https://forum.ansible.com/u/wagfeliz)\
**Post date:** [January 30, 2020, 10:38am UTC](https://forum.ansible.com/t/ansible-winrm-dont-run-concurrent-process/32082/3 "2020-01-30T10:38:27Z")

</div>

Hi Dylan Martin,

**Thanks for your response.**  
**I am simple starting 3 playbooks runs in the crontab as follows :**

**50 22 \* \* \* /etc/ansible/playbooks/bkp\_small\_1818.sh**  
**05 22 \* \* \* /etc/ansible/playbooks/bkp\_big\_1818.sh**  
**00 22 \* \* \* /etc/ansible/playbooks/bkp\_big2\_1818.sh**

**The shells calls the correspondent yamls : ansible-playbook /etc/ansible/playbooks/bkp\_small.yaml -f 10**

The tasks of all of it looks the same like this (diference are the database name and file names) :

task1 : win\_shell to the sqlserver to create the bkps  
task2 : win\_shell to zip the files  
task3 : win\_shell to copy files to local dir  
task4 : win\_copy to copy to cloud dir

They are starting simultaneous, but it seems for some reason the task waits some other playbooks task to finish, this is an example of my task1 :

- name: bkp\_sql  
win\_shell: DTEXEC.EXE /SQL “Maintenance Plans\AnsibleBkpSmall” /Server Server\DATACENTER  
remote\_user: user  
register: bkp\_sql
- debug: msg=“{{ bkp\_sql.stdout.split(‘\n’) }}”
- local\_action: copy content=“{{ bkp\_sql }}” dest=“/etc/ansible/playbooks/logs/s1.db.small.bkp.log”

I read the documentation you sent, but I am not sure I understood how it will help here, in my case, I am starting 3 playbooks simultaneous, for some reason 1 playbook waits for the other to finish, I could rewrite all of this to one playbook, that would fix my problem, but I am curious to know why this is happening, it seems to be something related with the winrm and maybe an simple winrm or windows setting fix it…

Regards,  
Wagner.
