# Strange behaviour or misconfig ? (RDS and local connection)

**URL:** <https://forum.ansible.com/t/strange-behaviour-or-misconfig-rds-and-local-connection/16617>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [October 27, 2014, 3:49pm UTC](https://forum.ansible.com/t/strange-behaviour-or-misconfig-rds-and-local-connection/16617 "2014-10-27T15:49:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolas\_G](https://avatars.discourse-cdn.com/v4/letter/n/a183cd/32.png) [@Nicolas\_G](https://forum.ansible.com/u/Nicolas_G)\
**Post date:** [October 27, 2014, 3:49pm UTC](https://forum.ansible.com/t/strange-behaviour-or-misconfig-rds-and-local-connection/16617/1 "2014-10-27T15:49:36Z")

</div>

Hi All,

I’m using the bellow config in order to deploy Ansible in AWS with no problem , the **db** servers are actually **RDS** instances and the rest is all EC2 instances.

### inventory hosts file:

[db]  
[db1.example.com](http://db1.example.com) ansible\_connection=local

[web]  
[web1.example.com](http://web1.example.com)

[web2.example.com](http://web2.example.com)

[web3.example.com](http://web3.example.com)

[app]  
[app1.example.com](http://app1.example.com)

[app2.example.com](http://app2.example.com)

[app3.example.com](http://app3.example.com)

### db.yml

- hosts: db  
**connection: local**  
gather\_facts: false  
roles:

- { role : db , tags: [‘db-role’] }

### web.yml

- hosts: web  
roles:

- { role : common , tags: [‘common-role’] }

- { role : web, tags: [‘web-role’] }

### app.yml

- hosts: app  
roles:

- { role : common , tags: [‘common-role’] }

- { role : app, tags: [‘app-role’] }

### site.yml

- include: db.yml

- include: web.yml

- include: app.yml

Unfortunately with this approach the common role will be executed in two runs “serialised”, one for the **web** playbook and one for the **app** playbook. Because I have many servers and various kind of roles, in order to improve the deployment time I have removed the common role from the **web** and **app** playbooks and created a **common.yml** playbook included in the site.yml file so ALL servers will execute the common role at the same time in parallel :

# common.yml

- hosts: all  
roles:

- { role : common , tags: [‘common-role’] }

### site.yml

- include: common.yml

- include: db.yml

- include: web.yml

- include: app.yml

Unfortunately this results in a strange behaviour, when the common role will be executed it will also try to run on the RDS server which is not possible since RDS instances have only mysql access and no ssh. This end up running the common role in the local controller system where I’m running Ansible from.. I guess this happens because of the **connection: local** I have defined in the db.yml playbook.

How can I avoid the common role from running locally ?

Regards,  
N.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [October 30, 2014, 5:57pm UTC](https://forum.ansible.com/t/strange-behaviour-or-misconfig-rds-and-local-connection/16617/2 "2014-10-30T17:57:00Z")

</div>

“Unfortunately this results in a strange behaviour, when the common role will be executed it will also try to run on the RDS server which is not possible since RDS instances have only mysql access and no ssh”

I would not apply those roles to those hosts and not try to talk to machines that don’t have SSH.
