# JSON user data when launching cloud instances?

**URL:** <https://forum.ansible.com/t/json-user-data-when-launching-cloud-instances/22298>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [August 16, 2016, 2:24pm UTC](https://forum.ansible.com/t/json-user-data-when-launching-cloud-instances/22298 "2016-08-16T14:24:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsmitty](https://avatars.discourse-cdn.com/v4/letter/r/9dc877/32.png) [@rsmitty](https://forum.ansible.com/u/rsmitty)\
**Post date:** [August 16, 2016, 2:24pm UTC](https://forum.ansible.com/t/json-user-data-when-launching-cloud-instances/22298/1 "2016-08-16T14:24:13Z")

</div>

Hi all,

Wondering if anyone else has seen this behavior and figured out a way around. I’m trying to pass in a json object at user\_data when launching some VMs in both AWS and OpenStack. The role is very simple and looks like:

`

{  
“role”: “node”,  
“hostname”: “test-host-name-1”,  
“clusterip”: “111.222.333.444”  
}

`

where the values set here are information about other VMs booted and passed in to these newly created VMs. I tried to pass the user data in directly, but received errors and moved to passing the data in via the lookup module like:

`  
user\_data: “{{ lookup(‘template’, ‘master-user-data.j2’) }}”

`

This seems to work, but converts all of the strings in the JSON object to have single quotes instead of double quotes, therefore no longer being valid JSON.

Has anyone found a workaround to this behavior? I’m on Ansible 2.1.1.0.
