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?