I need to pass the value to Ansible playbook yml from Jenkins
Could you please help me ?
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:
After that you can use the power of shell environment: Once you will configure this job then you can use it as you are normally using the ansible from the command line:
Please adjust the settings as per your environment.
Hope this will help you or other who want to use ansible from the jenkins.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With