@@RanjitSwain If let say I have the Ansible server installed in a separate box. How can I point the Jenkins pipeline script to execute the playbook from the Ansible server? What is the correct syntax to the Inventory file path of the remote Ansible server? Thanks
I found out that the fields "Playbook file path in workspace" and "Inventory file path in workspace" are typically used when your Ansible playbook and inventory files are located within the Jenkins workspace.
Hi, here it is just explained how we can use the Ansible plugin in Jenkins to integrate. Yes, off course we can use Ansible commands directly in the pipeline to execute the playbook.
Hi, no, it's not the Ansible executable directory. That is the plugins directory of Jenkins. You can execute a playbook from anywhere followed by the absolute path of the playbook
I am expecting your reply. I am a student .I have my master machine and worker machine and enabled passwordless ssh connection. When i create a job to execute playbook on jenkins. I have chosen build step and shell command i have specified the absoulete path to my playbook which resides on master machine and that playbook should be executed in my worker machine. Manually it gets executed and when i run on jenkins i get permission denied issue. I cannot give read permission to any other user or group for id_rsa it throws error "bad permission" if i don't set permission to jenkins than how can it access the private key? I have also set the user and private key in jenkins under manage credentials but still that is throwing same error.. any help would be appreciated, Thank you
Hi @anjaliadhikari4673, sorry for the late reply. You first need to setup the connectivity between ansible and Jenkins server. Also to work on different server you should use the key to connect to that server.
Thank you so much . . I have multiple .yml files in which multiple roles are defined. So do we need to put abc.yml, def.yml like this comma separated? and put the inventory file path. Right and rest of the files in ansible jenkins will take by default? Is that correct?
We have a tower job which we execute from ansible.. is it possible to auto trigger the tower job using jenkins ? I am new to this so not sure if tower job is the one which executes playbook .. pls confirm
Hi @bsk8643, yes, the tower job in Ansible tower executes the playbook. You can use "Ansible Tower" plugin in Jenkins to trigger tower jobs or, playbooks.
Sir, why u r always skipping some tasks, already installed, Alrdy server created, already configured....etc, Plsss make videos from scratch i.e. From EC2 preparation....then easy for us to practice ur videos.....
Dear Narendra, this video was made for who has some basic ideas on server creation and all. Thanks for your suggestions, In my upcoming videos I’ll keep this basics for the people who are completely new.
For newcomers, it may not be beneficial to omit the section on setting up authentication between Jenkins and a remote server, as it is crucial for resolving pipeline failures.
Hi, thanks for your valuable comment. Here is the link below on setting up authentication between Jenkins and a remote server. ruclips.net/video/03DP_P-A5jM/видео.html
Mr Ran, that's an awesome explanation. I enjoy watching your videos because you explicitly ensure they are easily understood by everyone.
Thank you for your valuable comment! I'm glad it helped you.
after watching this nexus tutorial. i am your new subscriber Sir.. Thanks so much.. I was looking for nexus with jenkins
Thanks 🙏
Awesome session 🎉
Thank you!
Nicely Explained ...👌
Glad you liked it
Thankyou sir
should ansible be installed on the server where the jenkins runs from or on the server/docker-container used as agent?
Hi, it’s up to you how you want to setup both ways it will work.
@@RanjitSwain If let say I have the Ansible server installed in a separate box. How can I point the Jenkins pipeline script to execute the playbook from the Ansible server? What is the correct syntax to the Inventory file path of the remote Ansible server? Thanks
I found out that the fields "Playbook file path in workspace" and "Inventory file path in workspace" are typically used when your Ansible playbook and inventory files are located within the Jenkins workspace.
The only issue I have is how to specify the SSH credentials ID for my Ansible server in the Pipeline script. Do you have any ideas on how to do that?
Directly we can’t use ansible commands in Jenkins pipeline every time we have to use generator?
Hi, here it is just explained how we can use the Ansible plugin in Jenkins to integrate. Yes, off course we can use Ansible commands directly in the pipeline to execute the playbook.
After installing the Ansible plugin on the Jenkins server, it seems that the Ansible executable directory is located at '/var/lib/jenkins/plugins/'.
Hi, no, it's not the Ansible executable directory. That is the plugins directory of Jenkins.
You can execute a playbook from anywhere followed by the absolute path of the playbook
I am expecting your reply. I am a student .I have my master machine and worker machine and enabled passwordless ssh connection. When i create a job to execute playbook on jenkins. I have chosen build step and shell command i have specified the absoulete path to my playbook which resides on master machine and that playbook should be executed in my worker machine. Manually it gets executed and when i run on jenkins i get permission denied issue. I cannot give read permission to any other user or group for id_rsa it throws error "bad permission" if i don't set permission to jenkins than how can it access the private key? I have also set the user and private key in jenkins under manage credentials but still that is throwing same error.. any help would be appreciated, Thank you
Hi @anjaliadhikari4673, sorry for the late reply. You first need to setup the connectivity between ansible and Jenkins server. Also to work on different server you should use the key to connect to that server.
Thank you so much . . I have multiple .yml files in which multiple roles are defined. So do we need to put abc.yml, def.yml like this comma separated? and put the inventory file path. Right and rest of the files in ansible jenkins will take by default? Is that correct?
Hi @gouravrelhan7372, you can call multiple roles like this:
roles:
- role:
name: myrole1
vars:
host: "db1"
myroles:
- mysql1
- apache1
- role:
name: myrole2
vars:
host: "db2"
myroles:
- mysql2
- apache2
We have a tower job which we execute from ansible.. is it possible to auto trigger the tower job using jenkins ? I am new to this so not sure if tower job is the one which executes playbook .. pls confirm
Hi @bsk8643, yes, the tower job in Ansible tower executes the playbook.
You can use "Ansible Tower" plugin in Jenkins to trigger tower jobs or, playbooks.
Hi sir.. Your session are always helpful to me.. But i have one question in this session.. Where i can find my private key
Hi @EntertainmentHouse377, the private key file is the one which you create during the EC2 instance creation.
Really helpful 👍
Glad it helped
great video
Glad you enjoyed it
sir please make a video on Jenkins-ansible-docker with separate servers for deploying a war file or jar file
Hi Naresh, Thanks for your nice suggestion! I will make one shortly.
Tq so much sir for ur response and reply
Sir, why u r always skipping some tasks, already installed, Alrdy server created, already configured....etc, Plsss make videos from scratch i.e. From EC2 preparation....then easy for us to practice ur videos.....
Dear Narendra, this video was made for who has some basic ideas on server creation and all.
Thanks for your suggestions, In my upcoming videos I’ll keep this basics for the people who are completely new.
For newcomers, it may not be beneficial to omit the section on setting up authentication between Jenkins and a remote server, as it is crucial for resolving pipeline failures.
Hi, thanks for your valuable comment. Here is the link below on setting up authentication between Jenkins and a remote server.
ruclips.net/video/03DP_P-A5jM/видео.html