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

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

it should be:

- include: rds.yml

The main playbook has it as

  • include: rds.yml

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

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.

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 ?

Try this instead:
`
vpc_security_groups: “{{ sg_mysql.group_id }}”

`

That fixed it… Thank you :slight_smile: