I have been trying to run Ansible playbook.yml
file from Jenkins using Jenkins's Ansible plugin, but it is throwing file or directory is not found error. However, I crossed checked paths more than one time and they are correct. The playbook.yml
also exists on the appropriate path. I also verified sshpass. Its latest version is installed on the linux master node.
Please note that. I have properly created the passwordless ssh connection between two Linux VMs machines. I am installing packages from Master Linux node to the slave Linux node using the playbook.yml
file. My Jenkins is installed on window machine and I am using ansible plugin from there. I also added both Linux machines on Jekins node managements.
This is the error:
Started by user Admin
Running as SYSTEM
[EnvInject] - Loading node environment variables.
Building remotely on Linux_Master_Nodes (Linux_Master_Node) in workspace /data/jenkins/workspace/Invoke_Ansible_Playbook
[Invoke_Ansible_Playbook] $ sshpass ******** /data/ansible/ansible-playbook /data/ansible/playbooks/playbook.yml -f 5 -u root -k
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 hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:79)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
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:1816)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
ERROR: Ansible playbook execution failed
Finished: FAILURE