SlideShare a Scribd company logo
Faisal Shaikh
Software And Devops Engineer
C I / C D U S I N G A N S I B L E A N D J E N K I N S
14th January 2015
- Continuous Integration (CI) is a development practice that requires developers to inte-
grate code into a shared repository several times a day. Each check-in is then verified by
an automated build, allowing teams to detect problems early. By integrating regularly,
you can detect errors quickly, and locate them more easily.
- ThoughtWorks blurb
- Continuous integration (CI) is the practice, in software engineering, of merging all devel-
oper working copies with a shared mainline several times a day.
- Wikipedia
D E F I N I T I O N S
- Every commit pushed to our repo should result in our entire infrastructure being
verified.
- Tools:
	 - Ansible
	 - Jenkins
	 - Monitoring system
	 - Application tests written by developers can be useful – especially those that exercise 	
all components of the stack.
	 - Test environments
	 - Version Control System – git
- Conventions
	 - An environment maps to a branch within git
	 e.g. origin/integration → integration
		 origin/staging	 → staging
A U T O M AT E D B U I L D
- Good
	 - Free open-source
	 - Lots of plugins - [1]
	 - Multi-platform support – think iOS, Windows builds.
	 - Easy scale out.
- Not so good
	 - GUI – good to start off
		 - Manual setup → Config drift → Build box is now special/golden/indispensable
		 - Difficult to reuse jobs
		 - Painful especially when n(jobs) > ~5
		 - Updating jobs becomes a nightmare
- Jenkins DSL is available
- We use Jenkins Job Builder by OpenStack
J E N K I N S
- Configure jobs in Jenkins using yaml files
- Simple templating engine
	- → variable substitution
	- → allows reuse of job definitions
- Yaml files mean that you can version job definitions
- Variable matrix definition
- Good job structure means that template re-use is possible which is a big win.
J E N K I N S J O B B U I L D E R
- job-template:
	 name: ‘ansible_{host-env}-{host-group}’
	 project-type: freestyle
	 defaults: global
	 scm:
		- git:
			url: ‘{git-repo-name}’
			branches:
				- ‘origin/{branch_name}’
			credentials-id: ‘{credential_id}’
	 builders:
		 - shell: |
			 ansible-playbook -i hosts -e “hosts={hostenv}
-{host-group}” --private-key=~/.ssh/id_rsa -u buildserver
node-{host-group}.yml
	wrappers:
		- ansicolor:
			colormap: xterm
	 publishers:
		- email:
			recipients: ‘{devops-email}’
			send-to-individuals: true
- project:
	 name: ‘ansible repo’
	 devops-email: ‘devops@example.com’
	 git-repo-name: git@github.com:mygithubaccount/myrepo
	branch_name:
		- ‘integration’:
			host-env: ‘uat’
		
		- ‘staging’:
			host-env: ‘stg’
		- ‘master’:
			host-env: ‘prod’
host-group:
	 - api
	 - cache
	 - db
	 - web
jobs:
	 - ‘ansible_{branch_name}_{host-group}’
J E N K I N S J O B B U I L D E R
- Quick demo showing jenkins and ansible
- 1. Jenkins plugins
	 - https://wiki.jenkins-ci.org/display/JENKINS/Plugins
- 2. Jenkins Job Builder by OpenStack
	 - https://github.com/openstack-infra/jenkins-job-builder
	 - http://ci.openstack.org/jenkins-job-builder/
R E F E R E N C E S
Thank you! We are hiring DevOps, Developers and QAs
Faisal Shaikh
Software And Devops Engineer
C I / C D U S I N G A N S I B L E A N D J E N K I N S
14th January 2015

More Related Content

PPTX
Monitor-Driven Development Using Ansible
PDF
Ansible Introduction
PDF
How Ansible Makes Automation Easy
PDF
Ansible - Hands on Training
PDF
Investigation of testing with ansible
PDF
Drone your Ansible
PDF
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
PDF
Ansible
Monitor-Driven Development Using Ansible
Ansible Introduction
How Ansible Makes Automation Easy
Ansible - Hands on Training
Investigation of testing with ansible
Drone your Ansible
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Ansible

What's hot (20)

PPTX
Ansible module development 101
PDF
Modern Infrastructure from Scratch with Puppet
PPTX
Ansible Best Practices - July 30
PDF
Continuous Updating with VersionEye at code.talks 2014
PDF
DevOps - Infrastructure as Code by Andre Marcelo-Tanner
PDF
A quick intro to Ansible
PPTX
Package Management on Windows with Chocolatey
PPTX
DevOps, A brief introduction to Vagrant & Ansible
PDF
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
PDF
Ansible and AWS
PPTX
Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
PDF
Steamlining your puppet development workflow
PDF
Docker
PDF
Network Automation with Ansible
PDF
Modern infrastructure as code with ansible cake fest 2021
PPTX
Ansible top 10 - 2018
PDF
Bosh 2-0-reloaded
PDF
F5 Automation and service discovery
PDF
ConcourseCi overview
PPTX
Testing Ansible Infrastructure With Serverspec
Ansible module development 101
Modern Infrastructure from Scratch with Puppet
Ansible Best Practices - July 30
Continuous Updating with VersionEye at code.talks 2014
DevOps - Infrastructure as Code by Andre Marcelo-Tanner
A quick intro to Ansible
Package Management on Windows with Chocolatey
DevOps, A brief introduction to Vagrant & Ansible
Puppet Camp Paris 2015: Continuous Integration of Puppet Code (Intermediate)
Ansible and AWS
Ansible Tutorial For Beginners | What Is Ansible And How It Works? | Ansible ...
Steamlining your puppet development workflow
Docker
Network Automation with Ansible
Modern infrastructure as code with ansible cake fest 2021
Ansible top 10 - 2018
Bosh 2-0-reloaded
F5 Automation and service discovery
ConcourseCi overview
Testing Ansible Infrastructure With Serverspec
Ad

Similar to CI/CD Using Ansible and Jenkins for Infrastructure (20)

PDF
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
PPT
Continuos integration for iOS projects
PDF
Dockerized maven
PPTX
Jenkins days workshop pipelines - Eric Long
PDF
Kubernetes: training micro-dragons for a serious battle
PDF
Ansible & Salt - Vincent Boon
PDF
Ansible is the simplest way to automate. MoldCamp, 2015
PDF
Ansible Tutorial.pdf
PDF
From development environments to production deployments with Docker, Compose,...
PDF
Ansible new paradigms for orchestration
PDF
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
PDF
Jazoon12 355 aleksandra_gavrilovska-1
PDF
David Kirk_Local Microservice Development in EKS.pdf
PPTX
Pipeline as code - new feature in Jenkins 2
PPTX
Job DSL Plugin for Jenkins
PDF
CIbox - OpenSource solution for making your #devops better
PPTX
Jenkins as a Service - Code all the way down
PPTX
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
PDF
Kubernetes - training micro-dragons without getting burnt
PDF
The Fairy Tale of the One Command Build Script
[HKOSCon x COSCUP 2020][20200801][Ansible: From VM to Kubernetes]
Continuos integration for iOS projects
Dockerized maven
Jenkins days workshop pipelines - Eric Long
Kubernetes: training micro-dragons for a serious battle
Ansible & Salt - Vincent Boon
Ansible is the simplest way to automate. MoldCamp, 2015
Ansible Tutorial.pdf
From development environments to production deployments with Docker, Compose,...
Ansible new paradigms for orchestration
Jenkins Days - Workshop - Let's Build a Pipeline - Los Angeles
Jazoon12 355 aleksandra_gavrilovska-1
David Kirk_Local Microservice Development in EKS.pdf
Pipeline as code - new feature in Jenkins 2
Job DSL Plugin for Jenkins
CIbox - OpenSource solution for making your #devops better
Jenkins as a Service - Code all the way down
Eclipse DemoCamp Bucharest 2014 - Continuous Integration Jenkins/Hudson
Kubernetes - training micro-dragons without getting burnt
The Fairy Tale of the One Command Build Script
Ad

Recently uploaded (20)

PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation theory and applications.pdf
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
A Presentation on Artificial Intelligence
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
KodekX | Application Modernization Development
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
Diabetes mellitus diagnosis method based random forest with bat algorithm
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Approach and Philosophy of On baking technology
Encapsulation theory and applications.pdf
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Machine learning based COVID-19 study performance prediction
A Presentation on Artificial Intelligence
The AUB Centre for AI in Media Proposal.docx
Chapter 3 Spatial Domain Image Processing.pdf
Encapsulation_ Review paper, used for researhc scholars
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
20250228 LYD VKU AI Blended-Learning.pptx
KodekX | Application Modernization Development
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Understanding_Digital_Forensics_Presentation.pptx
NewMind AI Monthly Chronicles - July 2025
Unlocking AI with Model Context Protocol (MCP)
Dropbox Q2 2025 Financial Results & Investor Presentation
Reach Out and Touch Someone: Haptics and Empathic Computing

CI/CD Using Ansible and Jenkins for Infrastructure

  • 1. Faisal Shaikh Software And Devops Engineer C I / C D U S I N G A N S I B L E A N D J E N K I N S 14th January 2015
  • 2. - Continuous Integration (CI) is a development practice that requires developers to inte- grate code into a shared repository several times a day. Each check-in is then verified by an automated build, allowing teams to detect problems early. By integrating regularly, you can detect errors quickly, and locate them more easily. - ThoughtWorks blurb - Continuous integration (CI) is the practice, in software engineering, of merging all devel- oper working copies with a shared mainline several times a day. - Wikipedia D E F I N I T I O N S
  • 3. - Every commit pushed to our repo should result in our entire infrastructure being verified. - Tools: - Ansible - Jenkins - Monitoring system - Application tests written by developers can be useful – especially those that exercise all components of the stack. - Test environments - Version Control System – git - Conventions - An environment maps to a branch within git e.g. origin/integration → integration origin/staging → staging A U T O M AT E D B U I L D
  • 4. - Good - Free open-source - Lots of plugins - [1] - Multi-platform support – think iOS, Windows builds. - Easy scale out. - Not so good - GUI – good to start off - Manual setup → Config drift → Build box is now special/golden/indispensable - Difficult to reuse jobs - Painful especially when n(jobs) > ~5 - Updating jobs becomes a nightmare - Jenkins DSL is available - We use Jenkins Job Builder by OpenStack J E N K I N S
  • 5. - Configure jobs in Jenkins using yaml files - Simple templating engine - → variable substitution - → allows reuse of job definitions - Yaml files mean that you can version job definitions - Variable matrix definition - Good job structure means that template re-use is possible which is a big win. J E N K I N S J O B B U I L D E R
  • 6. - job-template: name: ‘ansible_{host-env}-{host-group}’ project-type: freestyle defaults: global scm: - git: url: ‘{git-repo-name}’ branches: - ‘origin/{branch_name}’ credentials-id: ‘{credential_id}’ builders: - shell: | ansible-playbook -i hosts -e “hosts={hostenv} -{host-group}” --private-key=~/.ssh/id_rsa -u buildserver node-{host-group}.yml wrappers: - ansicolor: colormap: xterm publishers: - email: recipients: ‘{devops-email}’ send-to-individuals: true - project: name: ‘ansible repo’ devops-email: ‘devops@example.com’ git-repo-name: git@github.com:mygithubaccount/myrepo branch_name: - ‘integration’: host-env: ‘uat’ - ‘staging’: host-env: ‘stg’ - ‘master’: host-env: ‘prod’ host-group: - api - cache - db - web jobs: - ‘ansible_{branch_name}_{host-group}’ J E N K I N S J O B B U I L D E R
  • 7. - Quick demo showing jenkins and ansible
  • 8. - 1. Jenkins plugins - https://wiki.jenkins-ci.org/display/JENKINS/Plugins - 2. Jenkins Job Builder by OpenStack - https://github.com/openstack-infra/jenkins-job-builder - http://ci.openstack.org/jenkins-job-builder/ R E F E R E N C E S
  • 9. Thank you! We are hiring DevOps, Developers and QAs
  • 10. Faisal Shaikh Software And Devops Engineer C I / C D U S I N G A N S I B L E A N D J E N K I N S 14th January 2015