SlideShare a Scribd company logo
Building(a(Service(Delivery(
Assembly(Line(with(Vagrant,(
Packer,(and(Ansible( (
(
(
(
@ichristo(
ichristoffersen@vizuri.com(
My new app is
going to be the
next big thing!
Linux, IaaS, AWS,
Rackspace, VMWare,
oVirt, Spacewalk,
Cobbler, Puppet, Ansible,
Chef, Kickstart, Seed
Linux Administrators
SAN Engineers
Network Engineers
DevOps
ITOps
Service Level Agreements
Budgets
Staffing Guidance
Procurement Process
Authority to Operate
Auditing & Compliance
Infrastructure
My new app is
going to be the
next big thing!
Service Delivery :
Provisioning the right set of resources
required to support a set of activities in a
timely manner
Service Delivery :
Provisioning the right set of resources
required to support a set of activities in a
timely manner yesterday
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Week$1$ Week$2$ Week$3$ Week$4$ Week$6$ Week$6$ Week$7$ Week$8$
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Assembly line :
a manufacturing process in which work
moves from station to station until a final
product is produced
Order
Assemble
Ship Get0Rich
But what about quality? Can
we scale to meet demand?
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Code Smell:
A symptom in the source code that could
indicate potential problems or weakness
in the overall design
Example Code Smells:
Duplicate Code
Long Methods
Large, Multi-line Classes
Long Class Parameter Lists
Infrastructure Smell:
A symptom in the system architecture
that could indicate potential problems or
fragility in the overall system
Infrastructure Smells:
Gold Images
Teetering Stacks
Configuration Drift
Infrastructure Atrophy
SMELL :: GOLD IMAGE
PRESCRIPTION :: Use Packer
Automatically create
machine images for
multiple platforms from a
single blueprint
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
AWS: AMI
VMware: VMX + disks
VirtualBox: OVF + disks
DigitalOcean: Snapshots
and many more …
http://www.packer.io/docs/templates/builders.html
Wait? Didn’t you say
that ”gold” images
were bad.
Packer brings all the
benefits of ”gold”
images without the
baggage.
Automation
No human interaction. Great for
Continuous Integration / Deployment
Standardization
Use Puppet, Chef, Ansible, Bash to
configure the image
Repeatability
Template goes into version control
Image creation knowledge is now in code
Anyone can build / rebuild the base images
EXAMPLE
CentOS Image in both AWS &
Digital Ocean
{
"builders": [
{
"type" : "amazon-ebs",
"access_key" : "{{user `aws_access_key`}}",
"secret_key" : "{{user `aws_secret_key`}}",
"region" : "us-east-1",
"source_ami" : "ami-8997afe0",
"security_group_id" : "sg-8f7e24e4",
"instance_type" : "t1.micro",
"ssh_username" : "ec2-user",
"ssh_timeout" : "5m",
"ami_name" : "centos-baseline {{timestamp}}"
},
…
…
{
"type" : "digitalocean",
"api_key" : "{{user `do_api_key`}}",
"client_id" : "{{user `do_client_id`}}",
"image_id" : "562354",
"snapshot_name" : "centos-baseline {{timestamp}}"
}
]
…
}
$ packer validate base-image.json
Template validated successfully.
$ packer build base-image.json
amazon-ebs output will be in this color.
digitalocean output will be in this color.
…
==> amazon-ebs: Deleting temporary keypair...
Build 'amazon-ebs' finished.
==> digitalocean: Destroying droplet...
==> digitalocean: Deleting temporary ssh key...
Build 'digitalocean' finished.
==> Builds finished. The artifacts of successful builds are:
--> digitalocean: A snapshot was created: 'centos-baseline
1396457723' in region 'New York 1'
SMELL :: Teetering Stacks
+
PRESCRIPTION
Mature, stable, proven. Development
since Jan 2010. Used by thousands of
companies.
Deploy to Multiple
Providers
AWS, DigitalOcean, HP Cloud,
Joyent, KVM, libvirt, lxc,
OpenStack, Rackspace, Vmware,
VirtualBox
vagrant up --provider=foo
•  Simplifies the provisioning
process for servers.
•  Easier to have an instance per
systems component.
•  Copy files to new images. (i.e.
Keys, Scripts, RPMs)
Workflow
www.vagrantbox.es
Leverage Your own
Packer Images 
•  Base Image as starting point.
•  Integrates with multiple
“provisioners” – Puppet, Chef,
Ansible, Bash
Automation
No human interaction. Great for
Continuous Delivery
Standardization
Can also use Puppet, Chef, Ansible, Bash
Use Packer images as base images
Repeatability
Template goes into version control
Image creation knowledge is now in code
Anyone can build / rebuild the environment
EXAMPLE
Multiple CentOS Images
created in AWS from base AMI
Vagrant.configure("2") do |config|
config.vm.box = "dummy"
config.vm.box_url = "https://github.com/mitchellh/
vagrant-aws/raw/master/dummy.box"
config.vm.provider :aws do |aws, override|
aws.access_key_id = "YOUR KEY"
aws.secret_access_key = "YOUR SECRET KEY"
aws.keypair_name = "KEYPAIR NAME”
aws.ami = ”ami-9baa9cf2”
override.ssh.username = "ec2-user"
override.ssh.forward_agent = true
override.ssh.private_key_path = "PATH TO YOUR
PRIVATE KEY"
end
end
Vagrantfile
$ vagrant up --provider=aws
Use `vagrant plugin` commands to manage plugins. This warning
will be removed in the next version of Vagrant.
Bringing machine 'test-broker' up with 'aws' provider...
Bringing machine 'test-node-01' up with 'aws' provider...
Bringing machine 'test-node-02' up with 'aws' provider…
Running Vagrant
SMELL :: Configuration Drift
PRESCRIPTION
•  Configuration Management tool
like Puppet, Chef, CFEngine
•  Quick to get started
•  Builds on familiar tools
•  Run commands over SSH. No
additional agents required
EXAMPLE
Configure NTP on Multiple
CentOS AWS Images
…
config.vm.provision :ansible do |ansible|
ansible.sudo = true
ansible.playbook = "provisioning/ansible/playbook.yml”
ansible.verbose = true
end
- hosts: all
tasks:
- name: ensure ntpd is at the latest version
yum: pkg=ntp state=latest
notify:
- restart ntpd
handlers:
- name: restart ntpd
service: name=ntpd state=restarted
$ vagrant provision
Use `vagrant plugin` commands to manage plugins. This warning
will be removed in the next version of Vagrant.
Bringing machine 'test-broker' up with 'aws' provider...
Bringing machine 'test-node-01' up with 'aws' provider...
Bringing machine 'test-node-02' up with 'aws' provider...
WARNING: Nokogiri was built against LibXML version 2.8.0, but
has dynamically loaded 2.9.1
Installing a LAMP Stack on CentOS
EXAMPLE
Provision a CentOS LAMP
Stack in AWS
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
boxes.each do |box|
config.vm.define box[:name], primary: box[:primary] do |config|
config.vm.box = "aws-centos"
config.vm.box_url =
https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box
…
config.vm.provision :shell, :privileged => false, :inline => "sudo
yum -y install screen"
config.vm.provision :ansible do |ansible|
ansible.sudo = true
ansible.playbook = "provisioning/ansible/playbook-
lamp.yml"
ansible.verbose = true
end
…
- name : Install LAMP Stack
user: ec2-user
hosts: all
tasks:
- name: Install mysql
yum: name=mysql-server state=latest
- name: install httpd
yum: name=httpd
- name: Install php for mysql
yum: name=$item
with_items:
- php
- php-mysql
- mysql-server
$ vagrant up --provider=aws
Use `vagrant plugin` commands to manage plugins. This warning
will be removed in the next version of Vagrant.
Bringing machine 'test-broker' up with 'aws' provider...
Bringing machine 'test-node-01' up with 'aws' provider...
Bringing machine 'test-node-02' up with 'aws' provider...
WARNING: Nokogiri was built against LibXML version 2.8.0, but
has dynamically loaded 2.9.1
$ vagrant provision
vagrantup.com packer.io ansible.com
Thank you

More Related Content

What's hot (20)

PDF
Packer
Diego Pacheco
 
PPTX
Automation with Packer and TerraForm
Wesley Charles Blake
 
PPTX
Building Windows Images with Packer
Matt Wrock
 
PPTX
Packer
Nitesh Saini
 
PDF
(2016-06-11) Packer: Make Multi-Platform Images
garrett honeycutt
 
PDF
Ansible and AWS
Peter Sankauskas
 
PDF
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
rmcleay
 
PPT
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Jeff Geerling
 
PDF
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Timothy Appnel
 
PPTX
Ansible: How to Get More Sleep and Require Less Coffee
Sarah Z
 
PDF
Mitchell Hashimoto, HashiCorp
Ontico
 
PDF
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Tomas Doran
 
PPTX
Automating aws infrastructure and code deployments using Ansible @WebEngage
Vishal Uderani
 
PDF
Build automated Machine Images using Packer
Marek Piątek
 
PDF
A quick intro to Ansible
Dan Vaida
 
PDF
Getting started with Ansible
Ivan Serdyuk
 
PDF
Ansible Case Studies
Greg DeKoenigsberg
 
PDF
Ansible Intro - June 2015 / Ansible Barcelona User Group
Orestes Carracedo
 
PPTX
Learn you some Ansible for great good!
David Lapsley
 
PPTX
ILM - Pipeline in the cloud
Aaron Carey
 
Automation with Packer and TerraForm
Wesley Charles Blake
 
Building Windows Images with Packer
Matt Wrock
 
Packer
Nitesh Saini
 
(2016-06-11) Packer: Make Multi-Platform Images
garrett honeycutt
 
Ansible and AWS
Peter Sankauskas
 
DevOps in a Regulated World - aka 'Ansible, AWS, and Jenkins'
rmcleay
 
Local Dev on Virtual Machines - Vagrant, VirtualBox and Ansible
Jeff Geerling
 
Ansible v2 and Beyond (Ansible Hawai'i Meetup)
Timothy Appnel
 
Ansible: How to Get More Sleep and Require Less Coffee
Sarah Z
 
Mitchell Hashimoto, HashiCorp
Ontico
 
Chasing AMI - Building Amazon machine images with Puppet, Packer and Jenkins
Tomas Doran
 
Automating aws infrastructure and code deployments using Ansible @WebEngage
Vishal Uderani
 
Build automated Machine Images using Packer
Marek Piątek
 
A quick intro to Ansible
Dan Vaida
 
Getting started with Ansible
Ivan Serdyuk
 
Ansible Case Studies
Greg DeKoenigsberg
 
Ansible Intro - June 2015 / Ansible Barcelona User Group
Orestes Carracedo
 
Learn you some Ansible for great good!
David Lapsley
 
ILM - Pipeline in the cloud
Aaron Carey
 

Viewers also liked (16)

PPTX
Plan, Deploy & Manage Modern Applications Leveraging vCloud Automation Center...
Puppet
 
PPTX
Vagrant Up in 5 Easy Steps
Trevor Roberts Jr.
 
PPTX
Vagrant step-by-step guide for Beginners
Sagar Acharya
 
PDF
Vagrant vs docker? Melhor vagrant + docker
Wellington Silva
 
PDF
Provisioning & DevOps at Amis25
Francisco Arturo Viveros
 
PDF
Jsonnet, terraform & packer
David Cunningham
 
PDF
London Hug 19/5 - Terraform in Production
London HashiCorp User Group
 
PDF
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
bridgetkromhout
 
PDF
Introduction to Vagrant
Marcelo Pinheiro
 
PDF
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Ontico
 
PDF
NVMf: 5 млн IOPS по сети своими руками / Андрей Николаенко (IBS)
Ontico
 
PPTX
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Docker, Inc.
 
PDF
SEP DevOps Ignite Talk - Packer
Ryan Sweeney
 
PPTX
Ppt on unemployment
manav500
 
PDF
Hype vs. Reality: The AI Explainer
Luminary Labs
 
PDF
3 Things Every Sales Team Needs to Be Thinking About in 2017
Drift
 
Plan, Deploy & Manage Modern Applications Leveraging vCloud Automation Center...
Puppet
 
Vagrant Up in 5 Easy Steps
Trevor Roberts Jr.
 
Vagrant step-by-step guide for Beginners
Sagar Acharya
 
Vagrant vs docker? Melhor vagrant + docker
Wellington Silva
 
Provisioning & DevOps at Amis25
Francisco Arturo Viveros
 
Jsonnet, terraform & packer
David Cunningham
 
London Hug 19/5 - Terraform in Production
London HashiCorp User Group
 
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
bridgetkromhout
 
Introduction to Vagrant
Marcelo Pinheiro
 
Testing applications with traffic control in containers / Alban Crequy (Kinvolk)
Ontico
 
NVMf: 5 млн IOPS по сети своими руками / Андрей Николаенко (IBS)
Ontico
 
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Docker, Inc.
 
SEP DevOps Ignite Talk - Packer
Ryan Sweeney
 
Ppt on unemployment
manav500
 
Hype vs. Reality: The AI Explainer
Luminary Labs
 
3 Things Every Sales Team Needs to Be Thinking About in 2017
Drift
 
Ad

Similar to Service Delivery Assembly Line with Vagrant, Packer, and Ansible (20)

PPTX
Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...
POSSCON
 
PDF
CI and CD
Ladislav Prskavec
 
PDF
Small Python Tools for Software Release Engineering
pycontw
 
PDF
CI and CD
Ladislav Prskavec
 
PDF
Cutting through the fog of cloud
Kyle Rames
 
KEY
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
SV Ruby on Rails Meetup
 
PDF
Kube-AWS
CoreOS
 
PDF
Continuous Delivery: The Next Frontier
Carlos Sanchez
 
ODP
Puppet and Apache CloudStack
Puppet
 
ODP
Infrastructure as code with Puppet and Apache CloudStack
ke4qqq
 
PPTX
Configuration management and deployment with ansible
Ivan Dimitrov
 
PDF
Antons Kranga Building Agile Infrastructures
Antons Kranga
 
PDF
Omaha (Google Update) server
Dmitry Lyfar
 
PPTX
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
Puppet
 
PDF
Getting started with puppet and vagrant (1)
Puppet
 
ODP
Puppetpreso
ke4qqq
 
KEY
fog or: How I Learned to Stop Worrying and Love the Cloud
Wesley Beary
 
ODP
Puppet and CloudStack
ke4qqq
 
PDF
AWS Lambda with Serverless Framework and Java
Manish Pandit
 
PDF
Ansible with AWS
Allan Denot
 
Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...
POSSCON
 
Small Python Tools for Software Release Engineering
pycontw
 
Cutting through the fog of cloud
Kyle Rames
 
How I Learned to Stop Worrying and Love the Cloud - Wesley Beary, Engine Yard
SV Ruby on Rails Meetup
 
Kube-AWS
CoreOS
 
Continuous Delivery: The Next Frontier
Carlos Sanchez
 
Puppet and Apache CloudStack
Puppet
 
Infrastructure as code with Puppet and Apache CloudStack
ke4qqq
 
Configuration management and deployment with ansible
Ivan Dimitrov
 
Antons Kranga Building Agile Infrastructures
Antons Kranga
 
Omaha (Google Update) server
Dmitry Lyfar
 
Puppet Camp Seattle 2014: Puppet: Cloud Infrastructure as Code
Puppet
 
Getting started with puppet and vagrant (1)
Puppet
 
Puppetpreso
ke4qqq
 
fog or: How I Learned to Stop Worrying and Love the Cloud
Wesley Beary
 
Puppet and CloudStack
ke4qqq
 
AWS Lambda with Serverless Framework and Java
Manish Pandit
 
Ansible with AWS
Allan Denot
 
Ad

More from Isaac Christoffersen (10)

PDF
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
Isaac Christoffersen
 
PDF
The CIO's alternative
Isaac Christoffersen
 
PDF
JBoss Community vs Enterprise
Isaac Christoffersen
 
PDF
Manage Java Applications in an Open Hybrid Cloud
Isaac Christoffersen
 
ODP
Liberate Your Files with a Private Cloud Storage Solution powered by Open Source
Isaac Christoffersen
 
PDF
Brms road map_10-17-12
Isaac Christoffersen
 
PDF
How to Modernize Your Database Platform to Realize Consolidation Savings
Isaac Christoffersen
 
PDF
Destination Marketing Open Source and Cloud Presentation
Isaac Christoffersen
 
PDF
Seam CMJUG Presentation
Isaac Christoffersen
 
PDF
Vizuri Exadata East Coast Users Conference
Isaac Christoffersen
 
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
Isaac Christoffersen
 
The CIO's alternative
Isaac Christoffersen
 
JBoss Community vs Enterprise
Isaac Christoffersen
 
Manage Java Applications in an Open Hybrid Cloud
Isaac Christoffersen
 
Liberate Your Files with a Private Cloud Storage Solution powered by Open Source
Isaac Christoffersen
 
Brms road map_10-17-12
Isaac Christoffersen
 
How to Modernize Your Database Platform to Realize Consolidation Savings
Isaac Christoffersen
 
Destination Marketing Open Source and Cloud Presentation
Isaac Christoffersen
 
Seam CMJUG Presentation
Isaac Christoffersen
 
Vizuri Exadata East Coast Users Conference
Isaac Christoffersen
 

Recently uploaded (20)

PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Per Axbom: The spectacular lies of maps
Nexer Digital
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
introduction to computer hardware and sofeware
chauhanshraddha2007
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PDF
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Per Axbom: The spectacular lies of maps
Nexer Digital
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
The Future of Artificial Intelligence (AI)
Mukul
 
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Build with AI and GDG Cloud Bydgoszcz- ADK .pdf
jaroslawgajewski1
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
introduction to computer hardware and sofeware
chauhanshraddha2007
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
TrustArc Webinar - Navigating Data Privacy in LATAM: Laws, Trends, and Compli...
TrustArc
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
GDG Cloud Munich - Intro - Luiz Carneiro - #BuildWithAI - July - Abdel.pdf
Luiz Carneiro
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Researching The Best Chat SDK Providers in 2025
Ray Fields
 

Service Delivery Assembly Line with Vagrant, Packer, and Ansible

  • 2. My new app is going to be the next big thing!
  • 3. Linux, IaaS, AWS, Rackspace, VMWare, oVirt, Spacewalk, Cobbler, Puppet, Ansible, Chef, Kickstart, Seed Linux Administrators SAN Engineers Network Engineers DevOps ITOps Service Level Agreements Budgets Staffing Guidance Procurement Process Authority to Operate Auditing & Compliance Infrastructure My new app is going to be the next big thing!
  • 4. Service Delivery : Provisioning the right set of resources required to support a set of activities in a timely manner
  • 5. Service Delivery : Provisioning the right set of resources required to support a set of activities in a timely manner yesterday
  • 7. Week$1$ Week$2$ Week$3$ Week$4$ Week$6$ Week$6$ Week$7$ Week$8$
  • 13. Assembly line : a manufacturing process in which work moves from station to station until a final product is produced
  • 15. But what about quality? Can we scale to meet demand?
  • 17. Code Smell: A symptom in the source code that could indicate potential problems or weakness in the overall design
  • 18. Example Code Smells: Duplicate Code Long Methods Large, Multi-line Classes Long Class Parameter Lists
  • 19. Infrastructure Smell: A symptom in the system architecture that could indicate potential problems or fragility in the overall system
  • 20. Infrastructure Smells: Gold Images Teetering Stacks Configuration Drift Infrastructure Atrophy
  • 21. SMELL :: GOLD IMAGE
  • 23. Automatically create machine images for multiple platforms from a single blueprint
  • 25. AWS: AMI VMware: VMX + disks VirtualBox: OVF + disks DigitalOcean: Snapshots and many more … http://www.packer.io/docs/templates/builders.html
  • 26. Wait? Didn’t you say that ”gold” images were bad.
  • 27. Packer brings all the benefits of ”gold” images without the baggage.
  • 28. Automation No human interaction. Great for Continuous Integration / Deployment Standardization Use Puppet, Chef, Ansible, Bash to configure the image Repeatability Template goes into version control Image creation knowledge is now in code Anyone can build / rebuild the base images
  • 29. EXAMPLE CentOS Image in both AWS & Digital Ocean
  • 30. { "builders": [ { "type" : "amazon-ebs", "access_key" : "{{user `aws_access_key`}}", "secret_key" : "{{user `aws_secret_key`}}", "region" : "us-east-1", "source_ami" : "ami-8997afe0", "security_group_id" : "sg-8f7e24e4", "instance_type" : "t1.micro", "ssh_username" : "ec2-user", "ssh_timeout" : "5m", "ami_name" : "centos-baseline {{timestamp}}" }, …
  • 31. … { "type" : "digitalocean", "api_key" : "{{user `do_api_key`}}", "client_id" : "{{user `do_client_id`}}", "image_id" : "562354", "snapshot_name" : "centos-baseline {{timestamp}}" } ] … }
  • 32. $ packer validate base-image.json Template validated successfully. $ packer build base-image.json amazon-ebs output will be in this color. digitalocean output will be in this color. … ==> amazon-ebs: Deleting temporary keypair... Build 'amazon-ebs' finished. ==> digitalocean: Destroying droplet... ==> digitalocean: Deleting temporary ssh key... Build 'digitalocean' finished. ==> Builds finished. The artifacts of successful builds are: --> digitalocean: A snapshot was created: 'centos-baseline 1396457723' in region 'New York 1'
  • 35. Mature, stable, proven. Development since Jan 2010. Used by thousands of companies.
  • 36. Deploy to Multiple Providers AWS, DigitalOcean, HP Cloud, Joyent, KVM, libvirt, lxc, OpenStack, Rackspace, Vmware, VirtualBox vagrant up --provider=foo
  • 37. •  Simplifies the provisioning process for servers. •  Easier to have an instance per systems component. •  Copy files to new images. (i.e. Keys, Scripts, RPMs) Workflow
  • 39. Leverage Your own Packer Images •  Base Image as starting point. •  Integrates with multiple “provisioners” – Puppet, Chef, Ansible, Bash
  • 40. Automation No human interaction. Great for Continuous Delivery Standardization Can also use Puppet, Chef, Ansible, Bash Use Packer images as base images Repeatability Template goes into version control Image creation knowledge is now in code Anyone can build / rebuild the environment
  • 42. Vagrant.configure("2") do |config| config.vm.box = "dummy" config.vm.box_url = "https://github.com/mitchellh/ vagrant-aws/raw/master/dummy.box" config.vm.provider :aws do |aws, override| aws.access_key_id = "YOUR KEY" aws.secret_access_key = "YOUR SECRET KEY" aws.keypair_name = "KEYPAIR NAME” aws.ami = ”ami-9baa9cf2” override.ssh.username = "ec2-user" override.ssh.forward_agent = true override.ssh.private_key_path = "PATH TO YOUR PRIVATE KEY" end end Vagrantfile
  • 43. $ vagrant up --provider=aws Use `vagrant plugin` commands to manage plugins. This warning will be removed in the next version of Vagrant. Bringing machine 'test-broker' up with 'aws' provider... Bringing machine 'test-node-01' up with 'aws' provider... Bringing machine 'test-node-02' up with 'aws' provider… Running Vagrant
  • 46. •  Configuration Management tool like Puppet, Chef, CFEngine •  Quick to get started •  Builds on familiar tools •  Run commands over SSH. No additional agents required
  • 47. EXAMPLE Configure NTP on Multiple CentOS AWS Images
  • 48. … config.vm.provision :ansible do |ansible| ansible.sudo = true ansible.playbook = "provisioning/ansible/playbook.yml” ansible.verbose = true end - hosts: all tasks: - name: ensure ntpd is at the latest version yum: pkg=ntp state=latest notify: - restart ntpd handlers: - name: restart ntpd service: name=ntpd state=restarted
  • 49. $ vagrant provision Use `vagrant plugin` commands to manage plugins. This warning will be removed in the next version of Vagrant. Bringing machine 'test-broker' up with 'aws' provider... Bringing machine 'test-node-01' up with 'aws' provider... Bringing machine 'test-node-02' up with 'aws' provider... WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.1 Installing a LAMP Stack on CentOS
  • 50. EXAMPLE Provision a CentOS LAMP Stack in AWS
  • 51. Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| boxes.each do |box| config.vm.define box[:name], primary: box[:primary] do |config| config.vm.box = "aws-centos" config.vm.box_url = https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box … config.vm.provision :shell, :privileged => false, :inline => "sudo yum -y install screen" config.vm.provision :ansible do |ansible| ansible.sudo = true ansible.playbook = "provisioning/ansible/playbook- lamp.yml" ansible.verbose = true end …
  • 52. - name : Install LAMP Stack user: ec2-user hosts: all tasks: - name: Install mysql yum: name=mysql-server state=latest - name: install httpd yum: name=httpd - name: Install php for mysql yum: name=$item with_items: - php - php-mysql - mysql-server
  • 53. $ vagrant up --provider=aws Use `vagrant plugin` commands to manage plugins. This warning will be removed in the next version of Vagrant. Bringing machine 'test-broker' up with 'aws' provider... Bringing machine 'test-node-01' up with 'aws' provider... Bringing machine 'test-node-02' up with 'aws' provider... WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.1 $ vagrant provision