Hi Jordan, I created a new play based on your comment.

---

 - hosts: builders

   become: true

   tasks:

    -name: Install Cygwin

     win_command: C:\Users\pkmbuilder\Desktop\setup-x86_64.exe --root
C:\cygwin64 --quiet-mode --site http://cygwin.mirror.constant.com
--packages "openssh,rsync,zip,vim,wget,nano"


However, I get:


root@Raspi_Ctrl:/ansible/playbook# ansible-playbook cygwin64install.yml -i
/ansible/hosts

ERROR! Syntax Error while loading YAML.



The error appears to have been in '/ansible/playbook/cygwin64install.yml':
line 6, column 17, but may

be elsewhere in the file depending on the exact syntax problem.


The offending line appears to be:


    -name: Install Cygwin

     win_command: C:\Users\pkmbuilder\Desktop\setup-x86_64.exe --root
C:\cygwin64 --quiet-mode --site http://cygwin.mirror.constant.com
--packages "openssh,rsync,zip,vim,wget,nano"

                ^ here


I tried putting the command (Starting at C:\ )in single quotes and it said
this:

The offending line appears to be:


    -name: Install Cygwin

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

                ^ here

This one looks easy to fix.  It seems that there is a value started

with a quote, and the YAML parser is expecting to see the line ended

with the same kind of quote.  For instance:


    when: "ok" in result.stdout


Could be written as:


   when: '"ok" in result.stdout'


Or equivalently:


   when: "'ok' in result.stdout"


So obviously somethings missing or wrong.

Any ideas?


Thx

Larry

On Wed, Nov 8, 2017 at 4:06 PM, Jordan Borean <jborea...@gmail.com> wrote:

> Personally, I would bypass the batch file and just call the executable
> directly like
>
> - name: install Cygwin
>   win_command: C:\Users\pkmbuilder\setup-x86_64.exe --root C:\cygwin64
> --quiet-mode --site http://cygwin.mirror.constant.com --packages
> "openssh,rsync,zip,vim,wget"
>
> # Note if you are using an Ansible version before 2.4, change
> "openssh,rsync,zip,vim,wget" to \"openssh,rsync,zip,vim,wget\". If you
> are on 2.4 keep it as it is
>
> This way you aren't reliant on a file being present on the server and are
> bypassing cmd which could obfuscate some results. You can also use
> win_package but you would need to determine the product id before hand but
> doing so would give you some idempotency.
>
> Thanks
>
> Jordan
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/ansible-project/5F3UCDR3j_Y/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/40712154-453f-4b5a-894f-7483439f90f9%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/40712154-453f-4b5a-894f-7483439f90f9%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Thank you,
Larry Pescatore
Lab Engineer, ERG Inc. @ Google

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CADxK1ksNeh7B9FAEJBTGWqCMXZHqBn%3Du%3DH5ky-NBe-h%3DAaJZLw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to