Ansible or Jenkins pipelines for bigger jobs

0 votes

At the moment we are using combination of Jenkins pipelines and Ansible playbooks. Usually we end up with short ansible playbooks that are run either inside of Jenkins pipeline or just as a jenkins job.

What would be be better approach for more complicated, multi-step jobs?

For example one job consists of:

  1. Start ec2 instance from AMI
  2. Run migrations
  3. Pull latest code, compile and restart
  4. Create new AMI from temporary instance
  5. Terminate temporary instance

I do like the fact that I can handle user input in Jenkins pipelines as well as the graphic representation of every step in the pipeline. In example above each step would be probably its own little ansible playbook. Passing parameters from playbook to playbook isnt that straight forward, but we know how to do it.

I am not 100% sure if I am doing this up to best standard as during creating these pipelines I am thinking that this should probably be ansible and the other way arounnd.

Can anyone tell me how these two can work together?

Jun 17, 2018 in Jenkins by Atul
• 10,240 points
795 views

1 answer to this question.

0 votes
Well, you are indeed well aware of the limitations that each tool brings to the table,

The sweet spot would be what works the best for you and your company, now, ask yourself which approach would be easier to manage? which one would become too complicated when scaling?

I've done both approaches and found that the pipeline tools from jenkins seem to have the best effect in terms of "readability" and ease of management, this is specially evident when we had the chance to bring new members on the team and they can get a quick overview of the processes just by looking at our pipelines on jenkins,

Now, we have also used a combination of jenkins (just ci) + nexus (artifact management) + octopus (just cd) + ansible (provisioning) to handle everything on complicated pipelines,

Again, ask yourself what would be easier to manage, and what is most likely to grow over time (number of steps on the pipeline, number of pipelines or jobs, number of servers to manage, etc...) and take a decision based on that.

I hope it would help you resolve your query.
answered Jun 17, 2018 by shubham
• 7,340 points

Related Questions In Jenkins

+3 votes
7 answers

Is it possible to shift or move jobs between two jenkins servers?

Hi, You can copy Jobs in between your ...READ MORE

answered Dec 16, 2020 in Jenkins by MD
• 95,440 points
44,363 views
+2 votes
6 answers

Jenkins unable to run jobs (pending - waiting for next executor)

Increase the number of executors. I had ...READ MORE

answered Apr 24, 2019 in Jenkins by Maya
39,639 views
0 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
3,439 views
+2 votes
1 answer
0 votes
1 answer

Why is it displaying Jenkins build failure for Android app

I think you should try this. Try Uninstalling ...READ MORE

answered Apr 12, 2018 in Jenkins by shubham
• 7,340 points
1,493 views
0 votes
2 answers

Is possible for Jenkins to auto start and stop slave nodes?

Try Jenkins Plugin called as Slave SetupPlugin. This ...READ MORE

answered Aug 6, 2018 in Jenkins by Nilesh
• 7,050 points
6,270 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP