Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass the value to Ansible playbook from Jenkins

I need to pass the value to Ansible playbook yml from Jenkins

Could you please help me ?

enter image description here

like image 414
Karthick Avatar asked Dec 11 '22 17:12

Karthick


1 Answers

Ansible-Playbook plugin didn't give you the full power off Ansible with jenkins, I can share the method that how I am using ansible with jenkins which will give you exactly the same power as you are using it from the command line.

Let's say, you job name is "stackoverflow" then you can put the ansible-scripts directory inside the /var/lib/jenkins/jobs/stackoverflow/workspace and use it in your jenkins job like this:

enter image description here After that you can use the power of shell environment: enter image description here Once you will configure this job then you can use it as you are normally using the ansible from the command line: enter image description here

Please adjust the settings as per your environment.

Hope this will help you or other who want to use ansible from the jenkins.

like image 74
Arbab Nazar Avatar answered Dec 30 '22 09:12

Arbab Nazar