Can you please run playbook by using -vvv verbose mode. It will give more 
clarity of error.

On Wednesday, November 8, 2017 at 1:23:57 PM UTC-5, [email protected] 
wrote:
>
> HI folks,
> I have copied a batch file from ansible to windows and want to run it. 
> If i go to the windows machine and run it it works fine, but when I run it 
> from playbook it fails. 
>
> Here is the playbook:
>
>
> ---
>
>   - name: test script module
>
>     hosts: builders
>
>     tasks:
>
>       - name: run simple script
>
>         win_command: C:\Users\pkmbuilder\Desktop\configure_builder.bat
>
>
>
>
> And here is the batch:
>
> ::Install cygwin
>
> setup-x86_64.exe --root C:\cygwin64 --quiet-mode --site 
> http://cygwin.mirror.constant.com --packages "openssh,rsync,zip,vim,wget" 
> || exit /b 1
>
>
> When running via cli I get
>
>
> root@Raspi_Ctrl:/ansible/playbook# ansible-playbook 
> /ansible/playbook/batch.yml -i /ansible/hosts
>
>
> PLAY [test script module] 
> ******************************************************
>
>
> TASK [Gathering Facts] 
> *********************************************************
>
> ok: [100.]
>
>
> TASK [run simple script] 
> *******************************************************
>
> fatal: [100.6]: FAILED! => {"changed": true, "cmd": 
> "C:\\Users\\pkmbuilder\\Desktop\\configure_builder.bat", "delta": 
> "0:00:00.304048", "end": "2017-11-09 02:22:46.953264", "msg": "non-zero 
> return code", "rc": 1, "start": "2017-11-09 02:22:46.649216", "stderr": 
> "'setup-x86_64.exe' is not recognized as an internal or external 
> command,\r\noperable program or batch file.\r\n", "stderr_lines": 
> ["'setup-x86_64.exe' is not recognized as an internal or external 
> command,", "operable program or batch file."], "stdout": 
> "\r\nC:\\Users\\pkmbuilder>setup-x86_64.exe --root C:\\cygwin64 
> --quiet-mode --site http://cygwin.mirror.constant.com --packages 
> \"openssh,rsync,zip,vim,wget\"   || exit /b 1 \r\n", "stdout_lines": ["", 
> "C:\\Users\\pkmbuilder>setup-x86_64.exe --root C:\\cygwin64 --quiet-mode 
> --site http://cygwin.mirror.constant.com --packages 
> \"openssh,rsync,zip,vim,wget\"   || exit /b 1 "]}
>
> to retry, use: --limit @/ansible/playbook/batch.retry
>
>
> PLAY RECAP 
> *********************************************************************
>
> 100.            : ok=1    changed=0    unreachable=0    failed=1   
>
>
> What variables need I set to get this running?
>
>
> Thanks!
>
>
>
>
>

-- 
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/041fbb5c-b84b-4c13-98c9-285386eb1b26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to