# SSH connections on VPS while running ansible

**URL:** <https://forum.ansible.com/t/ssh-connections-on-vps-while-running-ansible/17569>\
**Category:** Ansible Project\
**Created:** [February 19, 2015, 10:47pm UTC](https://forum.ansible.com/t/ssh-connections-on-vps-while-running-ansible/17569 "2015-02-19T22:47:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dominick\_Rivard](https://avatars.discourse-cdn.com/v4/letter/d/85f322/32.png) [@Dominick\_Rivard](https://forum.ansible.com/u/Dominick_Rivard)\
**Post date:** [February 19, 2015, 10:47pm UTC](https://forum.ansible.com/t/ssh-connections-on-vps-while-running-ansible/17569/1 "2015-02-19T22:47:52Z")

</div>

Hi,

I am using ansible 1.8.4 to automate my development environment and I got a bit of a situation here that I can’t explain.  
In my playbook I create some folders where I host my projects files.

Once the directories are created in /srv/apps I use the git module to clone the projects from bitbucket.

The problem I am encountering is that I host my dev box at [vpsdime.com](http://vpsdime.com) because it is very cheap but I discovered they limit your VPS to 20 ssh connections to one remote host at the time.  
Once you reach the 20 limit they put you under a firewall rule that blocks you from reaching the host.

While running my playbook I was watching the number of ssh connections and they were steady to 2 for almost all the run, except when it reached the git module task.  
Here is the command line I was running:

`watch -n1 "sudo netstat | grep ssh | wc -l"`

2 ssh connections were fine because 1 for ansible, 1 for my ssh watching. But once we reached the git module it went crazy to 30+ connections.

How can I limit the git module to keep just a few connections and not go crazy like it is doing now?

If I do it manually by going in the /srv/apps/myproject and I do git pull … it works fine without opening.  
Could it be a ssh setting?

Thanks  
Dominick

Below is the task definition.

```auto
- name: install projects files
  git:
    repo=git@bitbucket.org:myproject/{{ item }}.git
    dest=/srv/apps/{{ item }}
    version={{ dev_branch }}
    accept_hostkey=yes
    key_file=myproject
    force=yes
  with_items:
    - project1
    - project2
    - project3
  register: code_has_been_changed

```
