1) I am using Jenkins API to trigger a job, so when my monitoring tool sensu sends request Jenkins API to trigger jenkins JOb the build starts. 2) I have tried even manually by hitting buildnow instead of using API calls to make sure that it is not API call problem.
What does my build contain? It runs on Master and runs a ansible play-book with help of ansible plugin
Problem: Once the build is complete it is successful it automatically triggers another build with no reason again and runs the build again. And it is a simple job configuration which runs on master and runs ansible-playbook with help of Jenkins provided plugin
Any one could help me in what might be the issue? Jenkins Version: 2.89.3 Ansible plugin: 0.8
Also i could see for a jenkins job Started by user xyz Started by user xyz Started by user xyz Started by user xyz Started by user xyz Started by user xyz Started by user xyz for a single build
Instead of using the Ansible plugin, I recommend doing the Jenkins way:
Create a pipeline from a Jenkinsfile with something like:
You can control your pipeline in a more clean an easy way than with the Ansible Plugin.
Does this issue happen when you build it manually also ?? if that's the case, then I would just looking into the configuration of Jenkins build and ensure that you haven't selected the option Build other project's in the Post Build section and mentioned the same project :P
EDITED
If you are facing the above issue then it happens because the project is been triggered more than once in my case, I have clicked on the job twice hence you see that started by admin twice because you would have checked the option
Do not allow concurrent builds
Jenkins has that issue where there is a slight delay to see the build happening when you click on a build project, hence making you click on it again.
If you see a job getting triggered twice even when you manually trigger, it might be in the way the Jenkins job is configured. Make sure you have concurrent build disabled.