SlideShare una empresa de Scribd logo
1 de 12
Descargar para leer sin conexión
Leveraging Ansible for CI/CD
Manisha Sahasrabudhe
VP Product Mgmt @ Shippable
Twitter: @ms_koffee
GitHub: manishas
Email: manisha@shippable.com
Fast innovation is key to survival
and winning
Continuous Delivery enables
Fast Innovation
• Every code change can be deployed to production, if
desired 

• Fully automated deployment pipelines with a manual
approval gate to push to Production

• All teams working together to deliver incremental software
updates quickly, reliably, and with better quality
app
code
build & test
app
pr
base docker
image
commit build, test &
push image
build & push
app image
review &
commit
machine
image
commit
build, test &
push ami
network
config
commit
prov test vpc prov test ecs
deploy app to
test
prov prod vpc
functional
test
prov prod ecs
deploy app to
prod
smoke
test
code repo
Events + transfer of state
CI/CD for a Single Application
SECOPS
DEV
OPS
TEST
• 450+ modules to create and manage
infrastucture, build AMIs, manage config, and
many other tasks
• Event-driven workflow automation platform for
ansible playbooks and other activities, with
visibility, traceability, and audit trails
• Manages state information across playbooks
• Makes playbooks reusable with runtime injection
of config & state
• Native functionality like CI, release mgmt, etc
• Declarative YAML language for versioning and
reusability
• Secure and agentless
• Low learning barrier
• Controls access with roles and permissions
• Runtime images with pre-configured tools,
CLIs, languages, etc
Demo
app
code
build & test
app
pr
base docker
image
commit build, test &
push image
build & push
app image
review &
commit
machine
image
commit
build, test &
push ami
network
config
commit
prov test vpc prov test ecs
deploy app to
test
prov prod vpc
functional
test
prov prod ecs
deploy app to
prod
smoke
test
code repo
Shippable handles
events + transfer of state
CI/CD for a Single Application
ansible Shippablejob
Job resource
CI/CD Building blocks
• Performs a CI/CD activity, such as CI,
provision a VPC or environment, create a
svc definition, manage release numbers,
deploy an app version
• Can be a Shippable native job, a wrapper
for an ansible playbook, or a generic job
running any custom script
• Executes on a pre-configured runtime,
depending on job type
• Contains information required to run jobs
• Also used to communicate state between
jobs
• Can be a Shippable defined resource or a
generic resource with key-value pairs
9
# Test VPC Creation Config
- name: test_conf
type: params
version:
params:
STATE_RES_NAME: "test_info"
VPC_NAME: "test_vpc"
VPC_CIDR_BLOCK: "210.0.0.0/16"
VPC_SUBNET_NAME: "test_vpc_subnet_pub"
VPC_SUBNET_CIDR_BLOCK: "210.0.0.0/24"
ECS_CLUSTER_NAME: "test-aws"
INST_COUNT: 2
INST_TAG: "test_ecs_inst"
INST_TYPE: “t2.micro"
# Output of Test Provisioning
- name: test_info
type: params
version:
params:
SEED: "initial_version"
example: shippable.resources.yml (partial)
Information for provisioning Test
VPC and Test Environment
Job that provisions test VPC will

use this resource to store state
10
# PROV Test VPC with Ansible
- name: prov_test_vpc
type: runSh
steps:
- IN: create_app_man
- IN: aws_region
- IN: aws_creds
- IN: ans_demo
switch: off
- IN: test_conf
- TASK:
- script: |
export AWS_ACCESS_KEY_ID=$(shipctl get_integration_resource_field
aws_creds aws_access_key_id)
export AWS_SECRET_ACCESS_KEY=$(shipctl get_integration_resource_field
aws_creds aws_secret_access_key)
cd $(shipctl get_resource_state ans_demo)
shipctl replace an_vpc_prov.yml
ansible-playbook -v an_vpc_prov.yml
- OUT: test_info
example: shippable.jobs.yml (partial)
# ansible playbook path
Shippable utility to replace env
vars for playbook
# test VPC config
# aws credentials & region
# don’t auto-trigger on change
# run after creating service definition, aka manifest
11
- hosts: localhost
connection: local
gather_facts: False
vars:
STATE_RES_NAME: "${STATE_RES_NAME}"
VPC_CIDR_BLOCK: "${VPC_CIDR_BLOCK}"
VPC_NAME: "${VPC_NAME}"
VPC_SUBNET_CIDR_BLOCK: "${VPC_SUBNET_CIDR_BLOCK}"
VPC_SUBNET_NAME: "${VPC_SUBNET_NAME}"
tasks:
- name: Create VPC {{ VPC_NAME }}
ec2_vpc_net:
name: "{{ VPC_NAME }}"
cidr_block: "{{ VPC_CIDR_BLOCK }}"
tags:
module: "{{ VPC_NAME }}"
register: vpc
- name: run cmd
shell: |
shipctl put_resource_state "{{ STATE_RES_NAME }}" VPC_ID "{{ vpc.vpc.id }}"
example: ans_vpc_prov.yml (partial)
Shippable sets these vars,
making the playbook reusable
Set state for use in
downstream jobs
Thanks!
Schedule a demo at:
https://www.shippable.com/schedule-demo.html
For more information:
Email: manisha@shippable.com
Twitter: @ms_koffee
Demo repository:
https://github.com/avinci/ans_demo

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Chef Automate Workflow Demo
Chef Automate Workflow DemoChef Automate Workflow Demo
Chef Automate Workflow Demo
 
Modern Infrastructure from Scratch with Puppet
Modern Infrastructure from Scratch with PuppetModern Infrastructure from Scratch with Puppet
Modern Infrastructure from Scratch with Puppet
 
Configuration Management in a Containerized World
Configuration Management in a Containerized WorldConfiguration Management in a Containerized World
Configuration Management in a Containerized World
 
Java Day Kharkiv - Next-gen engineering with Docker and Kubernetes
Java Day Kharkiv - Next-gen engineering with Docker and KubernetesJava Day Kharkiv - Next-gen engineering with Docker and Kubernetes
Java Day Kharkiv - Next-gen engineering with Docker and Kubernetes
 
Automated Infrastructure Testing
Automated Infrastructure TestingAutomated Infrastructure Testing
Automated Infrastructure Testing
 
Implementing your own Google App Engine
Implementing your own Google App Engine Implementing your own Google App Engine
Implementing your own Google App Engine
 
Quick and Solid - Baremetal on OpenStack | Rico Lin
Quick and Solid - Baremetal on OpenStack | Rico LinQuick and Solid - Baremetal on OpenStack | Rico Lin
Quick and Solid - Baremetal on OpenStack | Rico Lin
 
Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience
 
Cooking on Windows without the Windows Cookbook
Cooking on Windows without the Windows CookbookCooking on Windows without the Windows Cookbook
Cooking on Windows without the Windows Cookbook
 
Vagrant to-aws-flow
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flow
 
Drupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The BasicsDrupal Continuous Integration with Jenkins - The Basics
Drupal Continuous Integration with Jenkins - The Basics
 
Infrastructure as code
Infrastructure as codeInfrastructure as code
Infrastructure as code
 
Nike pop up habitat
Nike pop up   habitatNike pop up   habitat
Nike pop up habitat
 
PuppetConf 2016 Customer Keynote: Cloud, Containers & the Impact on IT - Jeff...
PuppetConf 2016 Customer Keynote: Cloud, Containers & the Impact on IT - Jeff...PuppetConf 2016 Customer Keynote: Cloud, Containers & the Impact on IT - Jeff...
PuppetConf 2016 Customer Keynote: Cloud, Containers & the Impact on IT - Jeff...
 
Continuous Integration on Steroids
Continuous Integration on SteroidsContinuous Integration on Steroids
Continuous Integration on Steroids
 
What Makes a Good Chef Cookbook? (May 2014 Edition)
What Makes a Good Chef Cookbook? (May 2014 Edition)What Makes a Good Chef Cookbook? (May 2014 Edition)
What Makes a Good Chef Cookbook? (May 2014 Edition)
 
Why so continuous
Why so continuousWhy so continuous
Why so continuous
 
System Hardening Using Ansible
System Hardening Using AnsibleSystem Hardening Using Ansible
System Hardening Using Ansible
 
Nike popup compliance workshop
Nike popup compliance workshopNike popup compliance workshop
Nike popup compliance workshop
 
Testing the Enterprise layers, with Arquillian
Testing the Enterprise layers, with ArquillianTesting the Enterprise layers, with Arquillian
Testing the Enterprise layers, with Arquillian
 

Similar a Leveraging Ansible for CI/CD

Continuous deployment steve povilaitis
Continuous deployment   steve povilaitisContinuous deployment   steve povilaitis
Continuous deployment steve povilaitis
Steve Povilaitis
 
RAYMOND L. WATSON
RAYMOND L. WATSONRAYMOND L. WATSON
RAYMOND L. WATSON
Ray Watson
 

Similar a Leveraging Ansible for CI/CD (20)

A Bit of Everything Chef
A Bit of Everything ChefA Bit of Everything Chef
A Bit of Everything Chef
 
Pivotal CloudFoundry on Google cloud platform
Pivotal CloudFoundry on Google cloud platformPivotal CloudFoundry on Google cloud platform
Pivotal CloudFoundry on Google cloud platform
 
Modernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-ArchitectModernizing Testing as Apps Re-Architect
Modernizing Testing as Apps Re-Architect
 
AWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for DevelopersAWS Summit Auckland - Application Delivery Patterns for Developers
AWS Summit Auckland - Application Delivery Patterns for Developers
 
AzureDay Kyiv 2016 Release Management
AzureDay Kyiv 2016 Release ManagementAzureDay Kyiv 2016 Release Management
AzureDay Kyiv 2016 Release Management
 
Cooking Up Windows with Chef Automate
Cooking Up Windows with Chef AutomateCooking Up Windows with Chef Automate
Cooking Up Windows with Chef Automate
 
Continuous deployment steve povilaitis
Continuous deployment   steve povilaitisContinuous deployment   steve povilaitis
Continuous deployment steve povilaitis
 
MohitBilakhia
MohitBilakhiaMohitBilakhia
MohitBilakhia
 
(DVO314) USA Today Uses Chef & AWS for Infrastructure Standardization
(DVO314) USA Today Uses Chef & AWS for Infrastructure Standardization(DVO314) USA Today Uses Chef & AWS for Infrastructure Standardization
(DVO314) USA Today Uses Chef & AWS for Infrastructure Standardization
 
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
Containerisation Hack of a Legacy Software Solution - Alex Carter - CodeMill ...
 
Simplified DevOps Bliss -with OpenAI API
Simplified DevOps Bliss -with OpenAI APISimplified DevOps Bliss -with OpenAI API
Simplified DevOps Bliss -with OpenAI API
 
PCF: Platform for a New Era - Kubernetes for the Enterprise - London
PCF: Platform for a New Era - Kubernetes for the Enterprise - LondonPCF: Platform for a New Era - Kubernetes for the Enterprise - London
PCF: Platform for a New Era - Kubernetes for the Enterprise - London
 
AWS re:Invent 2016: Deploying and Managing .NET Pipelines and Microsoft Workl...
AWS re:Invent 2016: Deploying and Managing .NET Pipelines and Microsoft Workl...AWS re:Invent 2016: Deploying and Managing .NET Pipelines and Microsoft Workl...
AWS re:Invent 2016: Deploying and Managing .NET Pipelines and Microsoft Workl...
 
.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp.NET Cloud-Native Bootcamp
.NET Cloud-Native Bootcamp
 
RAYMOND L. WATSON
RAYMOND L. WATSONRAYMOND L. WATSON
RAYMOND L. WATSON
 
Building a Continuous Delivery Pipeline With Visual Studio
Building a Continuous Delivery Pipeline With Visual StudioBuilding a Continuous Delivery Pipeline With Visual Studio
Building a Continuous Delivery Pipeline With Visual Studio
 
FV04_MostoviczT_RAD
FV04_MostoviczT_RADFV04_MostoviczT_RAD
FV04_MostoviczT_RAD
 
IBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the CloudIBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the Cloud
 
DevOps on Windows: How to Deploy Complex Windows Workloads | AWS Public Secto...
DevOps on Windows: How to Deploy Complex Windows Workloads | AWS Public Secto...DevOps on Windows: How to Deploy Complex Windows Workloads | AWS Public Secto...
DevOps on Windows: How to Deploy Complex Windows Workloads | AWS Public Secto...
 
DevOps e a transformação digital de aplicações
DevOps e a transformação digital de aplicaçõesDevOps e a transformação digital de aplicações
DevOps e a transformação digital de aplicações
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Leveraging Ansible for CI/CD

  • 1. Leveraging Ansible for CI/CD Manisha Sahasrabudhe VP Product Mgmt @ Shippable Twitter: @ms_koffee GitHub: manishas Email: manisha@shippable.com
  • 2. Fast innovation is key to survival and winning
  • 3. Continuous Delivery enables Fast Innovation • Every code change can be deployed to production, if desired • Fully automated deployment pipelines with a manual approval gate to push to Production • All teams working together to deliver incremental software updates quickly, reliably, and with better quality
  • 4. app code build & test app pr base docker image commit build, test & push image build & push app image review & commit machine image commit build, test & push ami network config commit prov test vpc prov test ecs deploy app to test prov prod vpc functional test prov prod ecs deploy app to prod smoke test code repo Events + transfer of state CI/CD for a Single Application SECOPS DEV OPS TEST
  • 5. • 450+ modules to create and manage infrastucture, build AMIs, manage config, and many other tasks • Event-driven workflow automation platform for ansible playbooks and other activities, with visibility, traceability, and audit trails • Manages state information across playbooks • Makes playbooks reusable with runtime injection of config & state • Native functionality like CI, release mgmt, etc • Declarative YAML language for versioning and reusability • Secure and agentless • Low learning barrier • Controls access with roles and permissions • Runtime images with pre-configured tools, CLIs, languages, etc
  • 7. app code build & test app pr base docker image commit build, test & push image build & push app image review & commit machine image commit build, test & push ami network config commit prov test vpc prov test ecs deploy app to test prov prod vpc functional test prov prod ecs deploy app to prod smoke test code repo Shippable handles events + transfer of state CI/CD for a Single Application ansible Shippablejob
  • 8. Job resource CI/CD Building blocks • Performs a CI/CD activity, such as CI, provision a VPC or environment, create a svc definition, manage release numbers, deploy an app version • Can be a Shippable native job, a wrapper for an ansible playbook, or a generic job running any custom script • Executes on a pre-configured runtime, depending on job type • Contains information required to run jobs • Also used to communicate state between jobs • Can be a Shippable defined resource or a generic resource with key-value pairs
  • 9. 9 # Test VPC Creation Config - name: test_conf type: params version: params: STATE_RES_NAME: "test_info" VPC_NAME: "test_vpc" VPC_CIDR_BLOCK: "210.0.0.0/16" VPC_SUBNET_NAME: "test_vpc_subnet_pub" VPC_SUBNET_CIDR_BLOCK: "210.0.0.0/24" ECS_CLUSTER_NAME: "test-aws" INST_COUNT: 2 INST_TAG: "test_ecs_inst" INST_TYPE: “t2.micro" # Output of Test Provisioning - name: test_info type: params version: params: SEED: "initial_version" example: shippable.resources.yml (partial) Information for provisioning Test VPC and Test Environment Job that provisions test VPC will use this resource to store state
  • 10. 10 # PROV Test VPC with Ansible - name: prov_test_vpc type: runSh steps: - IN: create_app_man - IN: aws_region - IN: aws_creds - IN: ans_demo switch: off - IN: test_conf - TASK: - script: | export AWS_ACCESS_KEY_ID=$(shipctl get_integration_resource_field aws_creds aws_access_key_id) export AWS_SECRET_ACCESS_KEY=$(shipctl get_integration_resource_field aws_creds aws_secret_access_key) cd $(shipctl get_resource_state ans_demo) shipctl replace an_vpc_prov.yml ansible-playbook -v an_vpc_prov.yml - OUT: test_info example: shippable.jobs.yml (partial) # ansible playbook path Shippable utility to replace env vars for playbook # test VPC config # aws credentials & region # don’t auto-trigger on change # run after creating service definition, aka manifest
  • 11. 11 - hosts: localhost connection: local gather_facts: False vars: STATE_RES_NAME: "${STATE_RES_NAME}" VPC_CIDR_BLOCK: "${VPC_CIDR_BLOCK}" VPC_NAME: "${VPC_NAME}" VPC_SUBNET_CIDR_BLOCK: "${VPC_SUBNET_CIDR_BLOCK}" VPC_SUBNET_NAME: "${VPC_SUBNET_NAME}" tasks: - name: Create VPC {{ VPC_NAME }} ec2_vpc_net: name: "{{ VPC_NAME }}" cidr_block: "{{ VPC_CIDR_BLOCK }}" tags: module: "{{ VPC_NAME }}" register: vpc - name: run cmd shell: | shipctl put_resource_state "{{ STATE_RES_NAME }}" VPC_ID "{{ vpc.vpc.id }}" example: ans_vpc_prov.yml (partial) Shippable sets these vars, making the playbook reusable Set state for use in downstream jobs
  • 12. Thanks! Schedule a demo at: https://www.shippable.com/schedule-demo.html For more information: Email: manisha@shippable.com Twitter: @ms_koffee Demo repository: https://github.com/avinci/ans_demo