Hi Zimidar,
For windows you have to use win_command it seems. This playbook worked
perfectly (I copied the file in another play):
---
- name: test script module
hosts: windows
tasks:
- name: run simple script
win_command: C:\Users\yrunner\Desktop\file.bat
On Mon, Oct 30, 2017 at 9:29 AM, Zimidar Boy <[email protected]> wrote:
> Hello Larry,
> Any task in ansible comes under task module i think so
> your script will look like this:
>
> - hosts: nuc
>
> tasks:
>
> - name: run simple script
>
> script: C:\Users\YRunner\Desktop\lp1.bat
>
>
> On Friday, October 27, 2017 at 10:33:06 AM UTC-4, Larry Pescatore wrote:
>>
>> HI Jordan,
>> Thanks for your help.
>> I've got it running now successfully. I have copied over a bat file
>> successfully several times.
>> Now, my next step is trying to get the batch files to run via ansible.
>> This is my play:
>>
>> ---
>>
>> - hosts: nuc
>>
>> - name: run simple script
>>
>> script: C:\Users\YRunner\Desktop\lp1.bat
>>
>> When I run it I get:
>>
>> root@Raspi_Ctrl:/ansible# ansible-playbook /ansible/playbook/test1.yml
>>
>> ERROR! 'script' is not a valid attribute for a Play
>>
>>
>> The error appears to have been in '/ansible/playbook/test1.yml': line 3,
>> column 3, but may
>>
>> be elsewhere in the file depending on the exact syntax problem.
>>
>>
>> The offending line appears to be:
>>
>>
>> - hosts: nuc
>>
>> - name: run simple script
>>
>>
>> ^ here
>>
>> So obv. That means I am using the wrong command. What is the right one?
>>
>>
>> On Thu, Oct 26, 2017 at 4:21 PM, Jordan Borean <[email protected]> wrote:
>>
>>> What I gave you is just the task to use in place of your win_copy one.
>>> You still need to specify the other playbook directives like hosts, tasks,
>>> roles and the like.
>>>
>>> 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/XEh1Fg3D9wE/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/a99e8e5c-56fa-4ae2-80ab-16bafbaca778%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/a99e8e5c-56fa-4ae2-80ab-16bafbaca778%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 a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/ansible-project/XEh1Fg3D9wE/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/
> msgid/ansible-project/1cf98b0a-442d-44b7-b729-d6517e499c32%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/1cf98b0a-442d-44b7-b729-d6517e499c32%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 [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/CADxK1kv-V43tnNgNLz-4z-h4xJYpHWUs%2BRYb%2By_o7H0Yv1Lvvw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.