USING ANSIBLE AND JENKINS IN CI/CD
An example lab
Ricardo Zanini (zanini@redhat.com) @zanini_os
Senior Middleware Technical Account Manager
INSERT DESIGNATOR, IF NEEDED
Introduction
Tools
Reference Architecture
Example pipeline flow
AGENDA
CI/CD with Ansible and Jenkins
Demo
Ansible Playbooks
Integration tips
Resources
INSERT DESIGNATOR, IF NEEDED
INTRODUCTION
INSERT DESIGNATOR, IF NEEDED
INTRODUCTION
What is this all about?
● Jenkins is great for CI/CD implementation.
● Ansible is a great tool for provisioning.
● Why not reuse our Ansible Roles?
● This process could be applied in different scenarios like on premises, cloud, containers,
bare metal and so on.
INSERT DESIGNATOR, IF NEEDED
TOOLS
For this lab, we are going to use:
● Vagrant + libvirt for virtualization
● Sonar Source for source code quality analysis.
● Maven
● GIT
● Nexus for artifactory repository
● Jenkins for CI/CD process flow
● Ansible for lab provisioning and application deployment
INSERT DESIGNATOR, IF NEEDED
REFERENCE ARCHITECTURE
INSERT DESIGNATOR, IF NEEDED
INSERT DESIGNATOR, IF NEEDED
PIPELINE FLOW
INSERT DESIGNATOR, IF NEEDED
THE PIPELINE
INSERT DESIGNATOR, IF NEEDED
PLAYBOOKS USED IN THIS LAB
INSERT DESIGNATOR, IF NEEDED
INFRASTRUCTURE PROVISIONING
Vagrant <3
INSERT DESIGNATOR, IF NEEDED
APPLICATION DEPLOYMENT
A simple 3 step ansible playbook
INSERT DESIGNATOR, IF NEEDED
DEMO
INSERT DESIGNATOR, IF NEEDED
INTEGRATION TIPS
Here some tips to avoid headaches:
● The target machines should have a Jenkins user with sudo to perform the needed
tasks.
● Prefer adding a SSH private key on Jenkins credentials and access it at the pipeline.
The target machines must have the public key.
● Install your roles before running the playbook.
● You may limit the provision on a set of hosts using the “-limit” option
INSERT DESIGNATOR, IF NEEDED
ANSIBLE PLAYBOOKS
Let's going to see each playbook in detail:
● Lab infrastructure provisioning with Ansible and Vagrant
● Application provisioning from Jenkins pipeline and Ansible
INSERT DESIGNATOR, IF NEEDED
RESOURCES
Everything you're going to need to reproduce this lab:
● Ansible Plugin
● Vagrant ALM @ GitHub
● Soccer Stats (example app) @ GitHub
● How to start using Ansible if I no nothing about platform?
INSERT DESIGNATOR, IF NEEDED
QUESTIONS?
THANK YOU
plus.google.com/+RedHat
linkedin.com/company/red-hat
youtube.com/user/RedHatVideos
facebook.com/redhatinc
twitter.com/RedHatNews

Jenkins + ansible, a love story (en)

  • 1.
    USING ANSIBLE ANDJENKINS IN CI/CD An example lab Ricardo Zanini (zanini@redhat.com) @zanini_os Senior Middleware Technical Account Manager
  • 2.
    INSERT DESIGNATOR, IFNEEDED Introduction Tools Reference Architecture Example pipeline flow AGENDA CI/CD with Ansible and Jenkins Demo Ansible Playbooks Integration tips Resources
  • 3.
    INSERT DESIGNATOR, IFNEEDED INTRODUCTION
  • 4.
    INSERT DESIGNATOR, IFNEEDED INTRODUCTION What is this all about? ● Jenkins is great for CI/CD implementation. ● Ansible is a great tool for provisioning. ● Why not reuse our Ansible Roles? ● This process could be applied in different scenarios like on premises, cloud, containers, bare metal and so on.
  • 5.
    INSERT DESIGNATOR, IFNEEDED TOOLS For this lab, we are going to use: ● Vagrant + libvirt for virtualization ● Sonar Source for source code quality analysis. ● Maven ● GIT ● Nexus for artifactory repository ● Jenkins for CI/CD process flow ● Ansible for lab provisioning and application deployment
  • 6.
    INSERT DESIGNATOR, IFNEEDED REFERENCE ARCHITECTURE
  • 7.
  • 8.
    INSERT DESIGNATOR, IFNEEDED PIPELINE FLOW
  • 9.
    INSERT DESIGNATOR, IFNEEDED THE PIPELINE
  • 10.
    INSERT DESIGNATOR, IFNEEDED PLAYBOOKS USED IN THIS LAB
  • 11.
    INSERT DESIGNATOR, IFNEEDED INFRASTRUCTURE PROVISIONING Vagrant <3
  • 12.
    INSERT DESIGNATOR, IFNEEDED APPLICATION DEPLOYMENT A simple 3 step ansible playbook
  • 13.
  • 14.
    INSERT DESIGNATOR, IFNEEDED INTEGRATION TIPS Here some tips to avoid headaches: ● The target machines should have a Jenkins user with sudo to perform the needed tasks. ● Prefer adding a SSH private key on Jenkins credentials and access it at the pipeline. The target machines must have the public key. ● Install your roles before running the playbook. ● You may limit the provision on a set of hosts using the “-limit” option
  • 15.
    INSERT DESIGNATOR, IFNEEDED ANSIBLE PLAYBOOKS Let's going to see each playbook in detail: ● Lab infrastructure provisioning with Ansible and Vagrant ● Application provisioning from Jenkins pipeline and Ansible
  • 16.
    INSERT DESIGNATOR, IFNEEDED RESOURCES Everything you're going to need to reproduce this lab: ● Ansible Plugin ● Vagrant ALM @ GitHub ● Soccer Stats (example app) @ GitHub ● How to start using Ansible if I no nothing about platform?
  • 17.
    INSERT DESIGNATOR, IFNEEDED QUESTIONS?
  • 18.