Ansible Jenkins Pipeline

Pipeline Workflow:

Github-Ansible-Jenkins-Artifactory-Docker

 

Summary

For DevOps teams to learn a truly practical and useful end-to-end Ansible-Jenkins pipeline that will enable them to create test and deploy code through Continuous Integration. This 3-day instructor-led technical class will give DevOps Engineers, System Operations and Code Developers the ability to:

  • Automate an entire End-To-End CI/CD (continuous integration / continuous deployment) Pipeline using Github, Ansible, Jenkins and Docker
  • Maintain code using Git and Github
  • Create, test and deploy Ansible playbooks through a Jenkins CI/CD pipeline
  • Run integration tests on Ansible playbooks
  • Create, store and run Docker images and containers
  • Store artifacts, such as Java .jar files, in JFrog Artifactory
  • Send email notifications automatically to update stakeholders about a pipeline’s success or failure status

Three-day course agenda:

Course Introduction

  • Course purpose
  • Agenda
  • Introductions
  • Accessing our lab environments

Technology Overview

  • Git – source control management
  • Ansible – configuration management
  • Integration testing
  • Jenkins – CI/CD (continuous integration / continuous deployment)
  • Docker – containerization
  • Artifactory – artifact storage
  • An End-To-End CI/CD Pipeline

Git and Github

  • Installation and configuration
  • Finding help on Git
  • Creating Local Git Repositories
  • Basic Commands – add, commit, status, log
  • Comparing commits: git diff
  • Using a Repository – git push
  • Branching and Merging
  • Using SSH keys with Git private repositories

Ansible

  • Ansible Use cases
  • Architecture and call flow
  • Installation and configuration
  • Control nodes and Managed nodes
  • Creating and managing your inventory – host definitions
  • Configuring users
  • Ansible CLI versus Playbook
  • Modules
    • Module overview
    • Structure of a module
    • Module Index
    • Idempotence
    • Example modules
      • Create a file
      • Delete a file
      • Change ownership and permissions of a file
      • Install a package
      • Start a service
      • Enable a service
      • Create a directory
      • Delete a directory structure
      • Create a user
    • Playbooks
      • Understanding YAML syntax
      • Writing plays with tasks
      • Including multiple plays
      • Creating an Apache playbook
      • Executing a playbook
    • Uploading a playbook to a Git repo
  • Integration Testing
    • Purpose and overview
    • Writing tests
    • Testing Ansible playbooks
  • Jenkins
    • Jenkins overview
      • Use case and history
      • Plugin architecture
    • Initializing a Jenkins server
    • Projects / Jobs
    • Freestyle Jobs
    • Declarative Pipeline Projects (CI/CD As Code)
    • Master and Agent nodes
    • Managing credentials
    • Integrating with source control management
    • Triggers: webhooks and polling
    • Storing artifacts – JFrog Artifactory
    • Notifications: Slack and SMTP email
    • Testing Ansible playbooks in Jenkins
    • Multibranch pipelines – building all branches in a single repository
    • Timeouts and retries
    • Post-build actions
    • Deploying and executing Ansible playbooks with Jenkins
  • Docker
    • Container use cases: the problems Docker solves
    • Docker concepts
      • Containers
      • Images
      • Dockerfiles
      • Repositories
      • Common Docker commands
      • Testing and running images
    • Storing Docker images
    • Docker Compose
      • Launching microservices using Docker
    • Build a Docker Image using Jenkins
      • Building the image
      • Storing the image
      • Running the image on an Agent
    • Deploying a Docker container with Ansible
  • Complete End-To-End Pipeline Lab
    • Write an Ansible playbook
    • Push the playbook to a branch within a Git repo
    • Configure Github and Jenkins so that upon receiving the playbook, Github will automatically trigger Jenkins to download and build the playbook, using a multibranch pipeline type project
    • Jenkins will test the playbook
    • If the playbook passes its tests, merge the playbook from a feature-branch to the master branch.
    • Jenkins will store the playbook and execute the playbook on the Ansible-managed hosts
    • The Ansible playbook will deploy a Docker container on our Ansible-managed nodes
    • Jenkins will send notifications over email regarding failures or the successful deployment of the playbook

Student Requirements:

  • You need familiarity and comfort with the following:
  • Writing code (of just about any flavor) in a text editor
  • Working on the command line
  • An understanding of basic system administration tasks – installing packages, configuring those packages & starting a service

Duration

3 Days