Thank you Jon for suggesting this solution. I tried by breaking
script_name.sh script into multiple scripts and all individual scripts
running properly, it is not throwing module failure error now. And when I
run a script_name.sh again ,it is throwing module failure error. The
conclusion is there is no issue with script or module. I just want to tell
one thing  that I observed .

We are using amazon ec2 instance(ubuntu) and from 2 days it is working
slowly. And when I deploy script  to server, it is taking 10-12 minutes to
execute script (before it was taking 2-3 minutes)and at one point process
get halt and  jenkins server through error. I don't understand why it is
happening, but I applied your solutions and it is working.

Thank you Jon



Regards,
Jayashri

On Tue, Jan 23, 2018 at 11:11 PM, 'J Hawkesworth' via Ansible Project <
ansible-project@googlegroups.com> wrote:

> It seems like that something that your script is doing is causing the
> command module to fail.  Without seeing the code for script_name.sh it is
> hard to make any useful suggestions about what is causing the failure.
>
> Also its possible you need some environment variables set by your login
> shell, so you might need to be using 'shell' instead of command.
>
> If possible I suggest breaking the script_name.sh into several separate
> scripts to help narrow down where it fails.
>
> Hope this helps,
>
> Jon
>
> On Tuesday, January 23, 2018 at 3:01:06 PM UTC, Jayashri Garud wrote:
>>
>> Sorry JYL. I posted it wrongly. It is actually
>>
>> -  name: deploy script_name script
>>   command:  /path/to/script/script_name.sh
>>
>>
>>
>>
>> On Tue, Jan 23, 2018 at 6:00 PM, <jean...@lenhof.eu.org> wrote:
>>
>>>
>>>
>>> 23 janvier 2018 13:07 "Jayashri Garud" <jayashri...@gmail.com> a écrit:
>>>
>>> Hi,
>>> I have a playbook for deployment . In which I have a task which execute
>>> script to extract artifacts. I am using jenkins server to run ansible.
>>> while running this playbook it is throwing error like "MODULE FAILURE".
>>> deployment.yml
>>> - run deployment script
>>> command: /path/to/my/script/.sh
>>> error:
>>>
>>> FAILED! => {"changed": false, "failed": true, "module_stderr": "", 
>>> "module_stdout": "", "msg": "MODULE FAILURE", "parsed": false}
>>>
>>> ansible version -2.0.0
>>>
>>>
>>> Try this :
>>> - name: run deployment script
>>> command: /path/to/my/script/.sh
>>>
>>> Explanations :
>>> You forget to add "name" before describiing the action.... So ansible
>>> try to interpret "run" as a module
>>> Be careful about indentations
>>>
>>> Regards,
>>>
>>> JYL
>>>
>>> --
>>> 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/6nEUY2Qfboo/unsubscribe.
>>> To unsubscribe from this group and all its topics, send an email to
>>> ansible-proje...@googlegroups.com.
>>> To post to this group, send email to ansible...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/ansible-project/a115e58a4bf6968a6f500898763375a7%40wwws.
>>> lenhof.eu.org
>>> <https://groups.google.com/d/msgid/ansible-project/a115e58a4bf6968a6f500898763375a7%40wwws.lenhof.eu.org?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> 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/6nEUY2Qfboo/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/7436be60-c1c4-407b-80ac-cb65b4609771%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/7436be60-c1c4-407b-80ac-cb65b4609771%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

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

Reply via email to