Ansible Jenkins Integration | Jenkins Pipeline script to execute Ansible Playbook

Поделиться
HTML-код
  • Опубликовано: 7 янв 2025

Комментарии • 38

  • @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 ...👌

  • @satishkumarpanda-l9t
    @satishkumarpanda-l9t Месяц назад

    Thankyou sir

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

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

  • @anjaliadhikari4673
    @anjaliadhikari4673 7 месяцев назад

    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  7 месяцев назад

      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.

  • @gouravrelhan7372
    @gouravrelhan7372 5 месяцев назад

    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  5 месяцев назад

      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

  • @bsk8643
    @bsk8643 10 месяцев назад

    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  10 месяцев назад

      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.

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

  • @ganeshrajput5925
    @ganeshrajput5925 Год назад

    Really helpful 👍

  • @sagarsriva
    @sagarsriva Год назад

    great video

  • @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.
      ruclips.net/video/03DP_P-A5jM/видео.html