Your pathing for "setup.iss" is probably wrong. PowerShell takes a 
"dot-backslash" approach when using the shell interactively, but that 
doesn't mean you should do the same when supplying absolute/relative paths 
to the ansible module. Also, PowerShell supports forward slashes, so feel 
free to use them instead, so you don't have to escape them.

I would assume you would use something like:

- name: install software
  win_package:
    path: "C:/Users/UserName/Desktop/Software/setup.exe"
    product_id: {guid}
    arguments: '-s -f1 "C:/Users/UserName/Desktop/Software/setup.iss" ' (i 
added a space between the last double-quote and single-quote just for 
clarification. Should probably be removed in prod)


On Wednesday, February 17, 2016 at 6:35:17 PM UTC+1, Gerald Spencer wrote:
>
> After further poking around after the win_package is parsed out to the 
> windows machine. Every backslash that is entered into the arguments is 
> doubled for the $complex_args variable in the powershell script that is ran 
> on the windows machine. 
>
> So 
>
>    - "-s -f1".\setup.iss" becomes "-s -f1".\\setup.iss" 
>    - "-s -f1".\\setup.iss" becomes "-s -f1".\\\\setup.iss" 
>    - "-s -f1"C:\\Users\\UserName\\Desktop\\Software\\setup.iss" becomes 
>    "-s -f1"C:\\\\Users\\\\UserName\\\\Desktop\\\\Software\\\\setup.iss"" 
>    
> I even set an enviroment variable for the full path of setup.iss and tried 
> to invoke it with 
>
>    - "-s -f1\'$env:referenceFilePath\' " ( \' in order to escape the 
>    single quote required to evaluate a variable in a double quote of a .ps1)
>    
> Unfortunately, this did not work with win_package. Though it did work when 
> I created a quick script on the local machine for testing. It seems to me 
> that the win_package parses the argument string in an odd way. 
>

-- 
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/493d29f5-a9cd-4e5c-928d-2c1d6174b585%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to