Due to backslash being added or removed win_command is not working as expected. It works fine when I pass the path in a variable.
- name: List the user details
win_command: '{{full_cmd}} {{cmd1}}'
Variables are as below:
full_cmd: some command
cmd1: Path="D:\\Program Files\\somepath"
cmd from Output:
"cmd": "some command Path=\"D:\\\\Program Files\\\\somepath\"",
But I want to pass it via a loop. Path is a list obtained via set_fact and list. Here it doesn't work as backslashes are not there as above.
win_command: '{{command}}"{{item}}" {{cmd2}}'
with_items: "{{path}}"
cmd from Output is:
"cmd": "some command Path=\"D:\\Program Files\\somepath\"",
"item": "D:\\Program Files\\somepath",
Please suggest what is wrong here.