Ansible Jenkins Integration | Jenkins Pipeline script to execute Ansible Playbook

Поділитися
Вставка
  • Опубліковано 19 жов 2024

КОМЕНТАРІ • 37

  • @songterence4186
    @songterence4186 Рік тому +1

    Mr Ran, that's an awesome explanation. I enjoy watching your videos because you explicitly ensure they are easily understood by everyone.

    • @RanjitSwain
      @RanjitSwain  Рік тому

      Thank you for your valuable comment! I'm glad it helped you.

  • @shamshadansari2018
    @shamshadansari2018 Рік тому

    after watching this nexus tutorial. i am your new subscriber Sir.. Thanks so much.. I was looking for nexus with jenkins

  • @syamkumar7751
    @syamkumar7751 Рік тому +2

    Awesome session 🎉

  • @SUBHAMisliveBGMI
    @SUBHAMisliveBGMI Рік тому +1

    Nicely Explained ...👌

  • @gouravrelhan7372
    @gouravrelhan7372 2 місяці тому

    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?

    • @RanjitSwain
      @RanjitSwain  2 місяці тому

      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

  • @EntertainmentHouse377
    @EntertainmentHouse377 Рік тому

    Hi sir.. Your session are always helpful to me.. But i have one question in this session.. Where i can find my private key

    • @RanjitSwain
      @RanjitSwain  Рік тому

      Hi @EntertainmentHouse377, the private key file is the one which you create during the EC2 instance creation.

  • @jubriladeyi5291
    @jubriladeyi5291 Рік тому +1

    should ansible be installed on the server where the jenkins runs from or on the server/docker-container used as agent?

    • @RanjitSwain
      @RanjitSwain  Рік тому

      Hi, it’s up to you how you want to setup both ways it will work.

    • @237311
      @237311 Рік тому

      @@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

    • @237311
      @237311 Рік тому +1

      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.

    • @237311
      @237311 Рік тому

      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?

  • @vishalvaishnav5856
    @vishalvaishnav5856 Рік тому +1

    Directly we can’t use ansible commands in Jenkins pipeline every time we have to use generator?

    • @RanjitSwain
      @RanjitSwain  Рік тому

      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.

  • @bsk8643
    @bsk8643 7 місяців тому

    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

    • @RanjitSwain
      @RanjitSwain  7 місяців тому

      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.

  • @anjaliadhikari4673
    @anjaliadhikari4673 5 місяців тому

    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

    • @RanjitSwain
      @RanjitSwain  4 місяці тому

      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.

  • @sagarsriva
    @sagarsriva Рік тому

    great video

  • @ganeshrajput5925
    @ganeshrajput5925 Рік тому

    Really helpful 👍

  • @237311
    @237311 Рік тому

    After installing the Ansible plugin on the Jenkins server, it seems that the Ansible executable directory is located at '/var/lib/jenkins/plugins/'.

    • @RanjitSwain
      @RanjitSwain  Рік тому

      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

  • @nareshbabuy8530
    @nareshbabuy8530 Рік тому

    sir please make a video on Jenkins-ansible-docker with separate servers for deploying a war file or jar file

    • @RanjitSwain
      @RanjitSwain  Рік тому

      Hi Naresh, Thanks for your nice suggestion! I will make one shortly.

    • @nareshbabuy8530
      @nareshbabuy8530 Рік тому

      Tq so much sir for ur response and reply

  • @naren06938
    @naren06938 Рік тому +1

    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.....

    • @RanjitSwain
      @RanjitSwain  Рік тому

      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.

  • @WasimBuden
    @WasimBuden Рік тому

    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.

    • @RanjitSwain
      @RanjitSwain  Рік тому +1

      Hi, thanks for your valuable comment. Here is the link below on setting up authentication between Jenkins and a remote server.
      ua-cam.com/video/03DP_P-A5jM/v-deo.html