win_environment - setting variable to value starting with %

15 views
Skip to first unread message

Tuyen Nguyen

unread,
Feb 12, 2019, 9:32:13 AM2/12/19
to Ansible Project
Hi

I am trying to set some environment variables to make the value start with %, and I am getting errors.

For example, if I wanted to set the TEMP environment to c:\temp

and then I want to set the PATH environment variable to %TEMP%

I am getting error "found character that cannot start any token"

I assume this is because % is a special character and cannot be at the beginning of a string.  How do I get around this?

Thanks in advance.

Regards,

Tuyen Nguyen

unread,
Feb 12, 2019, 4:21:44 PM2/12/19
to Ansible Project
Actually, I figured this out

Instead of the value being referenced as:

value: %test%
or
value: '%test%' which I think did not work as well

I put the value on the next line

value:
  '%test%'

And this works now as I needed.
Reply all
Reply to author
Forward
0 new messages