I don't think win_shell is necessary, you are truly trying to run an 
executable and don't want to confuse issues that may be related to how the 
shell handles things and how a command handles it. In your case you will 
need to enclose the full command with a single quote ', you tried this but 
I think forgot to close the string with a ' hence Ansible telling you that 
there was inbalanced quotes. I just tried the following on a brand new 
server and it was successful in install Cygwin.

- hosts: '2012R2'
gather_facts: no
tasks:
- name: download Cygwin installer
win_get_url:
url: https://cygwin.com/setup-x86_64.exe
dest: C:\temp\setup-x86_64.exe

- name: install Cygwin
win_command: 'C:\temp\setup-x86_64.exe --root C:\cygwin64 --quiet-mode 
--site http://cygwin.mirror.constant.com --packages 
"openssh,rsync,zip,vim,wget,nano"'


As you can see, the whole string for win_command is enclosed with ' and it 
has allowed me to continue to use " and \ without escaping anything. Here 
you can see Cygwin is installed and up and running

<https://lh3.googleusercontent.com/-k2_L64sggLI/WgS3VyqlLKI/AAAAAAAAARs/yxWDMQ_-gcoFq3WzyvLGOm-Cjbt7LGTtgCLcBGAs/s1600/Screen%2BShot%2B2017-11-10%2Bat%2B6.13.55%2Bam.png>



Thanks


Jordan

-- 
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/8d008be2-5b25-4f64-87eb-5ba5c1508e03%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to