# Command module and quotes

**URL:** <https://forum.ansible.com/t/command-module-and-quotes/23999>\
**Category:** Ansible Project\
**Created:** [March 17, 2017, 2:06pm UTC](https://forum.ansible.com/t/command-module-and-quotes/23999 "2017-03-17T14:06:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![burns498](https://avatars.discourse-cdn.com/v4/letter/b/b487fb/32.png) [@burns498](https://forum.ansible.com/u/burns498)\
**Post date:** [March 17, 2017, 2:06pm UTC](https://forum.ansible.com/t/command-module-and-quotes/23999/1 "2017-03-17T14:06:28Z")

</div>

Hello everyone - I have a simply quotation question that I can’t seem to find an answer to online for some reason.

What is the proper way to wrap this command module task, such that the embedded quotes and variables still pass through properly?

`

- name: Gather {{ uid }} system account password

# Requires the CLI agent to be installed and configured on the target server.

# Uses the delegate\_to command to ensure CLI is run on proper node. Defined in group\_vars.

tags: CLI  
command: ‘/opt/CARKaim/sdk/clipasswordsdk GetPassword -p AppDescs.AppID={{ CA\_AppID }} -p Query=“Safe={{ DIRECTORY\_CA\_Safe }};Folder=Root;Object={{ WMSADMIN\_CA\_Object }}” -p RequiredProps=Address,UserName -o Password’  
register: wmsadmin\_dir\_account\_pass  
changed\_when: false  
delegate\_to: “{{ CyberArkCLI\_hostname\_short }}”  
`

I have the whole command wrapped in single quotes and I want to retain the raw double quotes inside the command. If I review the -vvv output, I see this. It looks like Ansible/YAML is parsing the command and dropping the quotes I have in the code.

> “cmd”: [“/opt/CARKaim/sdk/clipasswordsdk”, “GetPassword”, “-p”, “AppDescs.AppID=”, “-p”, “Query=Safe=;Folder=Root;Object=”, “-p”, “RequiredProps=Address,UserName”, “-o”, “Password”]

How shall I change this up to retain those quotes?

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [March 17, 2017, 4:36pm UTC](https://forum.ansible.com/t/command-module-and-quotes/23999/2 "2017-03-17T16:36:52Z")

</div>

How you tried to escape the double quotes with backslash?
