# Ansible when creating an RDS instance: AttributeError: 'dict' object has no attribute 'split'

**URL:** <https://forum.ansible.com/t/ansible-when-creating-an-rds-instance-attributeerror-dict-object-has-no-attribute-split/17628>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [February 26, 2015, 4:06pm UTC](https://forum.ansible.com/t/ansible-when-creating-an-rds-instance-attributeerror-dict-object-has-no-attribute-split/17628 "2015-02-26T16:06:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahul\_Mehrotra](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@Rahul\_Mehrotra](https://forum.ansible.com/u/Rahul_Mehrotra)\
**Post date:** [February 26, 2015, 4:06pm UTC](https://forum.ansible.com/t/ansible-when-creating-an-rds-instance-attributeerror-dict-object-has-no-attribute-split/17628/1 "2015-02-26T16:06:54Z")

</div>

I am working on creating an AWS infrastructure based on Ansible.  
I have a playbook which creates an RDS instance. When I run the playbook standalone it executes perfectly & creates RDS instance. However when that playbook is called by another playbook using the

> 

include: rds.yml

It gives the following error

TASK: [create mysql RDS instance] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
failed: [localhost → 127.0.0.1] =\> {“failed”: true, “parsed”: false}  
Traceback (most recent call last):

File “/home/rahul/.ansible/tmp/ansible-tmp-1424469014.33-157847268952956/rds”, line 2419, in   
main()

File “/home/rahul/.ansible/tmp/ansible-tmp-1424469014.33-157847268952956/rds”, line 468, in main  
params[“vpc\_security\_groups”] = vpc\_security\_groups.split(‘,’)  
AttributeError: ‘dict’ object has no attribute ‘split’  
FATAL: all hosts have already failed – aborting

The ansible playbook for RDS which I am using is as follows

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [February 26, 2015, 4:13pm UTC](https://forum.ansible.com/t/ansible-when-creating-an-rds-instance-attributeerror-dict-object-has-no-attribute-split/17628/2 "2015-02-26T16:13:27Z")

</div>

it should be:

- include: rds.yml

---

<div class="post-metadata">

**Author:** ![Rahul\_Mehrotra](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@Rahul\_Mehrotra](https://forum.ansible.com/u/Rahul_Mehrotra)\
**Post date:** [February 26, 2015, 4:21pm UTC](https://forum.ansible.com/t/ansible-when-creating-an-rds-instance-attributeerror-dict-object-has-no-attribute-split/17628/3 "2015-02-26T16:21:24Z")

</div>

The main playbook has it as

- include: rds.yml

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [February 26, 2015, 4:23pm UTC](https://forum.ansible.com/t/ansible-when-creating-an-rds-instance-attributeerror-dict-object-has-no-attribute-split/17628/4 "2015-02-26T16:23:00Z")

</div>

the error seems to indicate bad data is being passed to the rds module

---

<div class="post-metadata">

**Author:** ![Rahul\_Mehrotra](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@Rahul\_Mehrotra](https://forum.ansible.com/u/Rahul_Mehrotra)\
**Post date:** [February 26, 2015, 4:40pm UTC](https://forum.ansible.com/t/ansible-when-creating-an-rds-instance-attributeerror-dict-object-has-no-attribute-split/17628/5 "2015-02-26T16:40:27Z")

</div>

I am not able to figure out which specific vars is bad…  
Is there a problem of file locking ???  
Because there is a sg\_mysql.yml file being called before rds.yml in main.yml

Something like

- include: sg\_mysql.yml
- include: rds.yml

sg\_mysql.yml is writing the security group id to be used by rds.yml

However the debug task on sg\_mysql shows that the id is getting read correctly by rds.yml.

---

<div class="post-metadata">

**Author:** ![Ravi\_Bhure](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@Ravi\_Bhure](https://forum.ansible.com/u/Ravi_Bhure)\
**Post date:** [February 26, 2015, 5:01pm UTC](https://forum.ansible.com/t/ansible-when-creating-an-rds-instance-attributeerror-dict-object-has-no-attribute-split/17628/6 "2015-02-26T17:01:50Z")

</div>

I am also facing the same issue while creating security group on aws, using Ansible 1.8.3 version and 1.6, not really sure but this is something wrong at aws api library ?

---

<div class="post-metadata">

**Author:** ![vaida.dan](https://avatars.discourse-cdn.com/v4/letter/v/5daacb/32.png) [@vaida.dan](https://forum.ansible.com/u/vaida.dan)\
**Post date:** [February 26, 2015, 5:08pm UTC](https://forum.ansible.com/t/ansible-when-creating-an-rds-instance-attributeerror-dict-object-has-no-attribute-split/17628/7 "2015-02-26T17:08:41Z")

</div>

Try this instead:  
`  
vpc\_security\_groups: “{{ sg\_mysql.group\_id }}”

`

---

<div class="post-metadata">

**Author:** ![Rahul\_Mehrotra](https://avatars.discourse-cdn.com/v4/letter/r/5e9695/32.png) [@Rahul\_Mehrotra](https://forum.ansible.com/u/Rahul_Mehrotra)\
**Post date:** [February 26, 2015, 9:01pm UTC](https://forum.ansible.com/t/ansible-when-creating-an-rds-instance-attributeerror-dict-object-has-no-attribute-split/17628/8 "2015-02-26T21:01:36Z")

</div>

That fixed it… Thank you 🙂
