You seem to be close, one thing to remember when dealing with Windows paths in double quotes is that you needs to properly escape the backslashes. E.g. your path could be one of the following (they all are the same after yaml parsing)
`
when not using quotes, no need to escape anything
path: C:\working{{ inventory_hostname }}
when using single quotes, you don’t need to escape backslashes
path: ‘C:\working{{ inventory_hostname }}’
when using double quotes, you need to escape backslashes, e.g. \n is newline with \n is “\n” as text
I tried first without quotes and was getting an error…I usually try without quotes… anyway, then I tried it as with double quotes and escaping the \’s and it worked… very curious will have to try without quotes at all again and see if perhaps I had some other error and was misinterpreting it as it is my first time using system variables in anger.
If you start with a jinja2 block or have ": " (with the leading space) in the value then you have to quote the whole line, otherwise you usually can get away with it.