ANSIBLE VERSION
2.7.5
SUMMARY
I have the below list of variables defined in all.yml
abc: 3V4L-CA6S-UHJ8
xyz: 06342107
MC_INI_VAR: " {{abc}} {{xyz}}"
This has been invoked in playbook using the below rule
name : Starting generation process
become: yes
become_user: centos
shell : java -jar run.jar {{MC_INI_VAR}}
register: out
- debug: var=o
At the remote machine the transformed command was
java -jar run.jar 3V4L-CA6S-UHJ8 1688647
If I just change the variable in all.yml to
abc: 3V4L-CA6S-UHJ8
xyz: “06342107”
At the remote machine the transformed command was
java -jar run.jar 3V4L-CA6S-UHJ8 06342107
My problem is that if xyz=06342108; it is sent correctly without quotes
Also, this value (in all.yml) is getting populated from another script which does not add quotes. I am reading about issues of handling long int in ansible variable and I need to understand on how can I fix this issue.
I do not wish to send this in quotes and and i have tried solutions like
MC_INI_VAR: " {{abc | string}} {{xyz}}" but it ain’t worked
Please suggest on how can I pass such values as string without quotes or if I can type cast those in playbook itself.