Hope someone can help me shed some light on this one:

Since Ansible is python-based, us Windows dudes generally have to stick an 
extra backslash anywhere we're manipulating Windows paths. However, in some 
cases this causes unexpected behavior. In my current case, I need to inject 
a file path into a json file on a Windows box. This path is defined as such 
in an Ansible var:
logfiles_path: "F:\\Logs"

In my template json file I add to this path, using the following:

"FilePath":"{{ logfiles_path }}\\*",

The goal is to populate the target json with 
"F:\\Logs\\*"

However, since Ansible kicks in the resulting file contains:
"F:\Logfiles\\*"

In other words, Ansible "normalises" the part of the path that comes from a 
variable, but not the part "outside" of the variable.

I'm not sure what the best way to solve this is - it would be great to have 
some builtin filters that would do "json normalization" of a string or 
something. How are people solving this?

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f5e78a71-cc11-4b99-9536-0d7c171a8ae1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to