# Ansible and Jenkins

**URL:** <https://forum.ansible.com/t/ansible-and-jenkins/32073>\
**Category:** Ansible Project\
**Tags:** windows, ubuntu\
**Created:** [January 28, 2020, 10:58am UTC](https://forum.ansible.com/t/ansible-and-jenkins/32073 "2020-01-28T10:58:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sai\_Prasha](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@Sai\_Prasha](https://forum.ansible.com/u/Sai_Prasha)\
**Post date:** [January 28, 2020, 10:58am UTC](https://forum.ansible.com/t/ansible-and-jenkins/32073/1 "2020-01-28T10:58:05Z")

</div>

I Installed Anisble Server on Windows by enabling WSL (Windows system for Linux ) having Ubuntu Client  
Now I have Jenkins Installed on the same Windows machine but when i try to run simple ansible command i am seeing the below Error .  
My question is that the jenkins server also has to be installed from Ubuntu Client on windows.

```auto
Started by user [ADMIN](http://localhost:6060/user/admin)
Running as SYSTEM
Building in workspace C:\Program Files (x86)\Jenkins\workspace\Adhoc
[Adhoc] $ sh -xe C:\WINDOWS\TEMP\jenkins946870556263797578.sh
The system cannot find the file specified
FATAL: command execution failed
java.io.IOException: CreateProcess error=2, The system cannot find the file specified
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(Unknown Source)
	at java.lang.ProcessImpl.start(Unknown Source)
Caused: java.io.IOException: Cannot run program "sh" (in directory "C:\Program Files (x86)\Jenkins\workspace\Adhoc"): CreateProcess error=2, The system cannot find the file specified
	at java.lang.ProcessBuilder.start(Unknown Source)
	at hudson.Proc$LocalProc.<init>(Proc.java:250)
	at hudson.Proc$LocalProc.<init>(Proc.java:219)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:936)
	at hudson.Launcher$ProcStarter.start(Launcher.java:454)
	at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
	at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:741)
	at hudson.model.Build$BuildExecution.build(Build.java:206)
	at hudson.model.Build$BuildExecution.doRun(Build.java:163)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
	at hudson.model.Run.execute(Run.java:1853)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:428)
Build step 'Execute shell' marked build as failure
Finished: FAILURE

```

---

<div class="post-metadata">

**Author:** ![P\_Varsha](https://avatars.discourse-cdn.com/v4/letter/p/e274bd/32.png) [@P\_Varsha](https://forum.ansible.com/u/P_Varsha)\
**Post date:** [January 28, 2020, 11:25am UTC](https://forum.ansible.com/t/ansible-and-jenkins/32073/2 "2020-01-28T11:25:12Z")

</div>

setup the ubuntu root directory path on the jenkins environment.

---

<div class="post-metadata">

**Author:** ![Sai\_Prasha](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@Sai\_Prasha](https://forum.ansible.com/u/Sai_Prasha)\
**Post date:** [January 28, 2020, 1:17pm UTC](https://forum.ansible.com/t/ansible-and-jenkins/32073/3 "2020-01-28T13:17:20Z")

</div>

yes , i did that , but still i see the same issue

---

<div class="post-metadata">

**Author:** ![Sai\_Prasha](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@Sai\_Prasha](https://forum.ansible.com/u/Sai_Prasha)\
**Post date:** [January 28, 2020, 1:21pm UTC](https://forum.ansible.com/t/ansible-and-jenkins/32073/4 "2020-01-28T13:21:58Z")

</div>

I have set the Ansible path in jenkins -\>Manage Jenkins-\>Global tool Configuration - ansible 2.5.1 path /usr/bin/ansible  
I could not execute bash command from jenkins where as it is working form cmd
