I fixed my issue, its not sshpass  issue, the ansible executable path 
specified on global tool configuration is wrong. I found the executable 
path when I did anisble --version and I updated the same from the above 
output and the playbook is running fine.

On Wednesday, May 3, 2023 at 3:07:58 PM UTC-7 Narmada Karthika wrote:

> Thank you,  I am not using any credentials here as I restricted to run 
> this Jenkins job on same Linux where ansible is installed.
> now I  get this error,
> /home/deploy-user/.jenkins/workspace/Ansible_Win_01 this is the location 
> where my github is cloned 
> I specified this as inventory file location 
> /home/deploy-user/.jenkins/workspace/Ansible_Win_01/ansible/inventory.txt
> and playbook 
> --/home/deploy-user/.jenkins/workspace/Ansible_Win_01/ansible/linux/linuxgitplaybook.yml
> FATAL: command execution failed
> java.io.IOException: Cannot run program "/usr/bin/ansible-playbook" (in 
> directory "/home/deploy-user/.jenkins/workspace/Ansible_Win_01"): 
> error=2, No such file or directory
>
> On Wednesday, May 3, 2023 at 10:54:08 AM UTC-7 Dick Visser wrote:
>
>> Yes that may be but the problem is that sshpass is not available.
>> You need to fix that and then the playbook will run.
>> How that would work with your Jenkins is up to you (or Jenkins). 
>>
>> On Wed, 3 May 2023 at 19:41, Narmada Karthika <chitt...@gmail.com> wrote:
>>
>>> Thanks for that, just to give little more background.
>>> I have pointed to run the job on the same node where i have ansible 
>>> installed and playbooks. And also the playbook to run on windows nodes.
>>>
>>> On Wednesday, May 3, 2023 at 10:31:04 AM UTC-7 Jorge Rúa wrote:
>>>
>>>> sshpass: Failed to run command: No such file or directory. Is sshpass 
>>>> in the $PATH for the user running jenkins? 
>>>>
>>>> On Wed, May 3, 2023, 19:23 Narmada Karthika <chitt...@gmail.com> wrote:
>>>>
>>>>> I am facing below problem with running ansible playbook from Jenkins. 
>>>>> I specified the location where I have my ansible playbook and inventory 
>>>>> file.
>>>>>
>>>>> sshpass: Failed to run command: No such file or directory FATAL: 
>>>>> command execution failed hudson.AbortException: Ansible playbook 
>>>>> execution 
>>>>> failed at 
>>>>> org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:262)
>>>>>  
>>>>> at 
>>>>> org.jenkinsci.plugins.ansible.AnsiblePlaybookBuilder.perform(AnsiblePlaybookBuilder.java:232)
>>>>>  
>>>>> at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123) at 
>>>>> hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
>>>>>  
>>>>> at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:21) at 
>>>>> hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:808)
>>>>>  
>>>>> at hudson.model.Build$BuildExecution.build(Build.java:199) at 
>>>>> hudson.model.Build$BuildExecution.doRun(Build.java:164) at 
>>>>> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:516)
>>>>>  
>>>>> at hudson.model.Run.execute(Run.java:1889) at 
>>>>> hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) at 
>>>>> hudson.model.ResourceController.execute(ResourceController.java:100) at 
>>>>> hudson.model.Executor.run(Executor.java:433) ERROR: Ansible playbook 
>>>>> execution failed Finished: FAILURE
>>>>>
>>>>> -- 
>>>>>
>>>> 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-proje...@googlegroups.com.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/ansible-project/42bd5af6-a9e3-40d7-9a76-9ab2c433d7efn%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/ansible-project/42bd5af6-a9e3-40d7-9a76-9ab2c433d7efn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> -- 
>>> 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-proje...@googlegroups.com.
>>>
>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/ansible-project/cf54611a-6d93-4eee-842c-9b0ac5033608n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/ansible-project/cf54611a-6d93-4eee-842c-9b0ac5033608n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> -- 
>> Sent from Gmail Mobile
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/42316090-ac39-4eed-93e4-60baf07c16c9n%40googlegroups.com.

Reply via email to