BTW here is my version.

root@Raspi_Ctrl:/ansible/playbook# ansible --version

ansible 2.5.0

  config file = /etc/ansible/ansible.cfg

  configured module search path = [u'/root/.ansible/plugins/modules',
u'/usr/share/ansible/plugins/modules']

  ansible python module location =
/usr/local/lib/python2.7/dist-packages/ansible

  executable location = /usr/local/bin/ansible

  python version = 2.7.13 (default, Jan 19 2017, 14:48:08) [GCC 6.3.0
20170124]

On Thu, Nov 9, 2017 at 8:56 AM, Larry Pescatore <[email protected]>
wrote:

> 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 <[email protected]> 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/to
>> pic/ansible-project/5F3UCDR3j_Y/unsubscribe.
>> To unsubscribe from this group and all its topics, 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/ms
>> gid/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
>



-- 
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 [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/CADxK1ksXj_iP1RMe1NBVvHb%2BhT_QB5_DNG5ayegk_2e9PWAjYQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to