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 16, 2018 in Jenkins by Atul
• 10,240 points
213 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 16, 2018 by shubham
• 6,890 points

Related Questions In Jenkins

+1 vote
5 answers

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

There are some Jenkins plugins out there ...READ MORE

answered Oct 25, 2018 in Jenkins by akaash
685 views
+2 votes
6 answers
+1 vote
3 answers

Rename jobs from jenkins file

Go to the Configure screen and edit the Project name field ...READ MORE

answered Oct 25, 2018 in Jenkins by Laila
537 views
+13 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 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
120 views
0 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
• 6,890 points
221 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
• 6,900 points
732 views