Reputation: 57
Trying to test simple ansible script I defined a variable.
variable: C:\Log\1.txt
Next I simply try to echo this variable.
-name: echo
debug: msg="{{ variable }}"
Got:
"msg": "C:\\Log\\1.txt"
Expected output:
"msg": "C:\Log\1.txt"
How can I get one slash in path output?
Thanks.
Upvotes: 2
Views: 4639
Reputation: 68289
Don't be confused by the fact that ansible-playbook prints debug messages in JSON encoded form, so some characters are escaped.
There's no duplicated slashes in the variable's value.
See my answer for different question for details: https://stackoverflow.com/a/39587120/2795592
Upvotes: 4