# Ansible + docker\_compose module: need DATABASES='{...}', but getting DATABASES='"{ ...}"'

**URL:** <https://forum.ansible.com/t/ansible-docker-compose-module-need-databases-but-getting-databases/37129>\
**Category:** Ansible Project\
**Created:** [September 20, 2022, 9:04am UTC](https://forum.ansible.com/t/ansible-docker-compose-module-need-databases-but-getting-databases/37129 "2022-09-20T09:04:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Denny\_Fuchs](https://avatars.discourse-cdn.com/v4/letter/d/b782af/32.png) [@Denny\_Fuchs](https://forum.ansible.com/u/Denny_Fuchs)\
**Post date:** [September 20, 2022, 9:04am UTC](https://forum.ansible.com/t/ansible-docker-compose-module-need-databases-but-getting-databases/37129/1 "2022-09-20T09:04:58Z")

</div>

Hello,

I’m fighting since hours with this problem. I have to add a JSON string into a container environment:

It works … if I have something like this:

…  
backoffice-sandbox.example.local:  
image: “{{BACKOFFICE\_IMAGE}}”  
restart: always  
container\_name: backoffice-gunicorn-sandbox  
environment:  
DATABASES: |-  
{ “default”: {}, … }

…

but it fails, if I put the string into a variable (like into for ansbile-vault) and using like this

…  
backoffice-sandbox.example.local:  
image: “{{BACKOFFICE\_IMAGE}}”  
restart: always  
container\_name: backoffice-gunicorn-sandbox  
environment:  
DATABASES: “{{ PROD\_DATABASE }}”

…

than I get DATABASES=‘“{ …}”’ which breaks then my setup … as it can’t parsed anymore by the application, because of the extra " ".

How can I avoid it, without the need of extra steps like files …

cu denny
