SlideShare a Scribd company logo
1 of 33
Download to read offline
© Copyright 2015 Coveros, Inc. All rights reserved.
Creating Disposable Test Environments
with Vagrant and Puppet
Gene Gotimer, Senior Architect
gene.gotimer@coveros.com
2© Copyright 2015 Coveros, Inc. All rights reserved.
 Coveros helps organizations accelerate the delivery of
business value through secure, reliable software
About Coveros
3© Copyright 2015 Coveros, Inc. All rights reserved.
Why Disposable Test Environments?
 Destructive testing
 Known baseline
 Available on-demand
 Not shared
 No vested interest in keeping them long-term
 Always up-to-date
4© Copyright 2015 Coveros, Inc. All rights reserved.
Tools Involved
 VirtualBox
– virtualization software
 Vagrant
– virtualization automation
 Puppet
– configuration management and automation
– Chef, Ansible, or SaltStack would work equally well
 Packer
– machine image automation
5© Copyright 2015 Coveros, Inc. All rights reserved.
VirtualBox
6© Copyright 2015 Coveros, Inc. All rights reserved.
Oracle VM VirtualBox
 Virtualization software from Oracle
 Free
 Runs on Windows, Mac, Linux
 Runs as an application
 Allows us to use local VMs
 Easy to install
 Works well with Vagrant
https://www.virtualbox.org/
7© Copyright 2015 Coveros, Inc. All rights reserved.
Vagrant
8© Copyright 2015 Coveros, Inc. All rights reserved.
Vagrant
 Virtualization workflow software from HashiCorp
 Free, open-source
 Runs on Windows, Mac, Linux
 Easy to install
 Works well with Puppet, Chef, Shell
– many other provisioners
 Works well with VirtualBox, VMware, Amazon Web Services
– many other providers
https://www.vagrantup.com/
9© Copyright 2015 Coveros, Inc. All rights reserved.
Creating a Vagrant Box
 To create a VM:
– mkdir starcanada‐vagrant
– cd starcanada‐vagrant
– vagrant box add hashicorp/precise64
– vagrant init hashicorp/precise64
– vagrant up
 vagrant box add
– downloads a “base box”
– boxes at https://atlas.hashicorp.com/search
 vagrant init
– builds a Vagrantfile with the base box
 vagrant up
– starts the VM
10© Copyright 2015 Coveros, Inc. All rights reserved.
Vagrantfile
 Vagrantfile
– lots of comments by default
– stock Vagrantfile without comments is:
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise64"
end
11© Copyright 2015 Coveros, Inc. All rights reserved.
vagrant up
 vagrant up
– imports the base box to VirtualBox
– makes sure the base box is up to date
– sets a unique name for the VM
– sets up networking (just NAT by default)
– sets up port forwarding (just SSH by default)
– boots VM
– replaces known, insecure SSH key with a new random key
– makes sure VirtualBox Guest Additions are installed
– mounts shared folders (/vagrant by default on the VM)
– provisions software (nothing by default)
12© Copyright 2015 Coveros, Inc. All rights reserved.
Access Vagrant Box
 To access a VM:
– vagrant ssh
 vagrant ssh
– connects to the VM via the forwarded SSH port
 requires an SSH client installed
– Git (https://msysgit.github.io/)
– openssh on Cygwin (http://www.cygwin.com/)
– PuTTY (http://www.chiark.greenend.org.uk/~sgtatham/putty/)
 requires converting the key format
13© Copyright 2015 Coveros, Inc. All rights reserved.
Rebuild Vagrant Box
 To rebuild a VM:
– vagrant destroy
– vagrant up
 vagrant destroy
– deletes a VM
 vagrant up
– starts the VM
14© Copyright 2015 Coveros, Inc. All rights reserved.
Puppet
15© Copyright 2015 Coveros, Inc. All rights reserved.
Puppet
 Configuration management software from PuppetLabs
 Vaguely Ruby-based, domain-specific language
 Free, open-source
 Runs on Windows, Mac, Linux
 Easy to install
 Works well with Vagrant
 Similar to Chef, Ansible, SaltStack
https://puppetlabs.com/
16© Copyright 2015 Coveros, Inc. All rights reserved.
Install Apache with Puppet
 Modify the Vagrantfile:
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise64"
config.vm.network "private_network", ip: "192.168.33.10"
config.puppet_install.puppet_version = '3.8.1'
config.vm.provision "shell", inline: <<‐SHELL
sudo puppet module install puppetlabs‐apache
SHELL
config.vm.provision "puppet" do |puppet|
puppet.manifests_path = "manifests"
puppet.manifest_file = "site.pp"
puppet.module_path = "modules"
end
end
17© Copyright 2015 Coveros, Inc. All rights reserved.
Vagrant Networking
 config.vm.network "private_network", ip: "192.168.33.10"
– sets up a new network interface on the box
– private_network = host-only
 only this box and other VMs on this box can reach it
18© Copyright 2015 Coveros, Inc. All rights reserved.
Vagrant Modules
 config.puppet_install.puppet_version = '3.8.1'
– Vagrant module from
https://github.com/mitchellh/vagrant/wiki/Available-Vagrant-Plugins
– vagrant‐puppet‐install
 installs Puppet version 3.8.1
 could have been :latest, but I want control
19© Copyright 2015 Coveros, Inc. All rights reserved.
Shell Provisioning
 config.vm.provision "shell", inline: <<‐SHELL
sudo puppet module install puppetlabs‐apache
SHELL
– here-doc that runs all the commands until SHELL
– this command installs a Puppet module from
https://forge.puppetlabs.com/puppetlabs
20© Copyright 2015 Coveros, Inc. All rights reserved.
Puppet Provisioning
 config.vm.provision "puppet" do |puppet|
puppet.manifests_path = "manifests"
puppet.manifest_file = "site.pp"
puppet.module_path = "modules"
end
– sets up a standard Puppet layout
– commands in manifests/site.pp
– reusable modules in modules
21© Copyright 2015 Coveros, Inc. All rights reserved.
Example Puppet Code
 Example init.pp file in the modules/website/manifests directory:
class website {
class { 'apache': }
apache::vhost { "${::fqdn}":
vhost_name => '*',
default_vhost => true,
port          => '80',
docroot => '/var/www',
}
file { '/var/www/index.html':
ensure  => 'file',
content => template('website/index.html.erb'),
owner   => 'root',
group   => 'www‐data',
mode    => '0640',
require => Class['apache'],
}
}
22© Copyright 2015 Coveros, Inc. All rights reserved.
Installing Apache httpd
 class { 'apache:' } 
– installs Apache httpd server
– sets up default configuration
23© Copyright 2015 Coveros, Inc. All rights reserved.
Configuring Apache httpd
 apache::vhost { "${::fqdn}":
vhost_name => '*',
default_vhost => true,
port          => '80',
docroot => '/var/www',
}
– sets up default virtual host
– listening on port 80
– document root is /var/www
24© Copyright 2015 Coveros, Inc. All rights reserved.
Installing Templated Content
 file { '/var/www/index.html':
ensure  => 'file',
content => template('website/index.html.erb'),
owner   => 'root',
group   => 'www‐data',
mode    => '0640',
require => Class['apache'],
}
– copies file from host box
– sets owner, group, and permissions
25© Copyright 2015 Coveros, Inc. All rights reserved.
Automation Advantages
 Deploy is now automated
 Automated = repeatable, easy, quick
 Test on the system, make any changes we want, then
destroy it, recreate it in a pristine condition
 Reuse the deployment scripts in all environments
– including production
– especially production
26© Copyright 2015 Coveros, Inc. All rights reserved.
Other Possibilities
 Template files
 Variable substitution/Configuration database
– YAML
– JSON
– Encrypted
 Multiple machines
 Different providers
– Managed
– VMware
– Amazon Web Services (AWS)
 Chef, Ansible, or SaltStack
27© Copyright 2015 Coveros, Inc. All rights reserved.
Packer
28© Copyright 2015 Coveros, Inc. All rights reserved.
Packer
 Machine image automation from HashiCorp
 Free, open-source
 Runs on Windows, Mac, Linux
 Easy to install
 Works well with Puppet, Chef, Shell
– many other provisioners
 Works well with VirtualBox, VMware, Amazon Web Services
– many other providers
https://packer.io/
29© Copyright 2015 Coveros, Inc. All rights reserved.
Packer Templates
 Packer templates on GitHub from Shiguredo, Inc.
 Templates for
– CentOS Linux 6.4, 6.5, 6.6, 7.0, 7.1
– Scientific Linux 6.4, 6.5, 7.0
– Ubuntu Linux 12.04, 14.04
 Fork and edit to create you own base boxes
https://github.com/shiguredo/packer-templates
30© Copyright 2015 Coveros, Inc. All rights reserved.
Wrap-Up
31© Copyright 2015 Coveros, Inc. All rights reserved.
Tools Recap
 VirtualBox
– virtualization software
– https://www.virtualbox.org/
 Vagrant
– virtualization automation
– https://www.vagrantup.com/
– Boxes: https://atlas.hashicorp.com/search
– Plugins:
https://github.com/mitchellh/vagrant/wiki/Available-
Vagrant-Plugins
32© Copyright 2015 Coveros, Inc. All rights reserved.
Tools Recap
 Puppet
– configuration management and automation
– https://puppetlabs.com/
– Modules: https://forge.puppetlabs.com/puppetlabs
 Packer
– machine image automation
– https://packer.io/
– Templates: https://github.com/shiguredo/packer-
templates
33© Copyright 2015 Coveros, Inc. All rights reserved.
Questions?
Gene Gotimer
gene.gotimer@coveros.com
http://www.coveros.com
@CoverosGene

More Related Content

What's hot

System Event Monitoring for Active Authentication
System Event Monitoring for Active AuthenticationSystem Event Monitoring for Active Authentication
System Event Monitoring for Active AuthenticationCoveros, Inc.
 
Journée DevOps : De l'intégration continue au déploiement continu avec Jenkins
Journée DevOps : De l'intégration continue au déploiement continu avec JenkinsJournée DevOps : De l'intégration continue au déploiement continu avec Jenkins
Journée DevOps : De l'intégration continue au déploiement continu avec JenkinsPublicis Sapient Engineering
 
360° Kubernetes Security: From Source Code to K8s Configuration Security
360° Kubernetes Security: From Source Code to K8s Configuration Security360° Kubernetes Security: From Source Code to K8s Configuration Security
360° Kubernetes Security: From Source Code to K8s Configuration SecurityDevOps.com
 
DevSecOps: Taking a DevOps Approach to Security
DevSecOps: Taking a DevOps Approach to SecurityDevSecOps: Taking a DevOps Approach to Security
DevSecOps: Taking a DevOps Approach to SecurityAlert Logic
 
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)CloudBees
 
DevSecOps: Key Controls to Modern Security Success
DevSecOps: Key Controls to Modern Security SuccessDevSecOps: Key Controls to Modern Security Success
DevSecOps: Key Controls to Modern Security SuccessPuma Security, LLC
 
Kubernetes and container security
Kubernetes and container securityKubernetes and container security
Kubernetes and container securityVolodymyr Shynkar
 
Jenkinsconf Presentation - Advance jenkins management with multiple projects.
Jenkinsconf Presentation - Advance jenkins management with multiple projects.Jenkinsconf Presentation - Advance jenkins management with multiple projects.
Jenkinsconf Presentation - Advance jenkins management with multiple projects.Ohad Basan
 
Building a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containersBuilding a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containersAmazon Web Services
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build PipelineSamuel Brown
 
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...Richard Bullington-McGuire
 
DevOpsDays Singapore - Continuous Auditing with Compliance as Code
DevOpsDays Singapore - Continuous Auditing with Compliance as CodeDevOpsDays Singapore - Continuous Auditing with Compliance as Code
DevOpsDays Singapore - Continuous Auditing with Compliance as CodeMatt Ray
 
Using Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure SecurityUsing Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure SecurityMandi Walls
 
Continuous deployment-at-flipkart
Continuous deployment-at-flipkartContinuous deployment-at-flipkart
Continuous deployment-at-flipkartPankaj Kaushal
 
System Hardening Using Ansible
System Hardening Using AnsibleSystem Hardening Using Ansible
System Hardening Using AnsibleSonatype
 
PKI in DevOps: How to Deploy Certificate Automation within CI/CD
PKI in DevOps: How to Deploy Certificate Automation within CI/CDPKI in DevOps: How to Deploy Certificate Automation within CI/CD
PKI in DevOps: How to Deploy Certificate Automation within CI/CDDevOps.com
 
What it feels like to live in a Security Enabled DevOps World
What it feels like to live in a Security Enabled DevOps WorldWhat it feels like to live in a Security Enabled DevOps World
What it feels like to live in a Security Enabled DevOps WorldKarun Chennuri
 
Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Mandi Walls
 
Banfootguns devseccon 2019
Banfootguns devseccon 2019Banfootguns devseccon 2019
Banfootguns devseccon 2019Morgan Roman
 
Bay Area Chef Meetup February
Bay Area Chef Meetup FebruaryBay Area Chef Meetup February
Bay Area Chef Meetup FebruaryJessica DeVita
 

What's hot (20)

System Event Monitoring for Active Authentication
System Event Monitoring for Active AuthenticationSystem Event Monitoring for Active Authentication
System Event Monitoring for Active Authentication
 
Journée DevOps : De l'intégration continue au déploiement continu avec Jenkins
Journée DevOps : De l'intégration continue au déploiement continu avec JenkinsJournée DevOps : De l'intégration continue au déploiement continu avec Jenkins
Journée DevOps : De l'intégration continue au déploiement continu avec Jenkins
 
360° Kubernetes Security: From Source Code to K8s Configuration Security
360° Kubernetes Security: From Source Code to K8s Configuration Security360° Kubernetes Security: From Source Code to K8s Configuration Security
360° Kubernetes Security: From Source Code to K8s Configuration Security
 
DevSecOps: Taking a DevOps Approach to Security
DevSecOps: Taking a DevOps Approach to SecurityDevSecOps: Taking a DevOps Approach to Security
DevSecOps: Taking a DevOps Approach to Security
 
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
 
DevSecOps: Key Controls to Modern Security Success
DevSecOps: Key Controls to Modern Security SuccessDevSecOps: Key Controls to Modern Security Success
DevSecOps: Key Controls to Modern Security Success
 
Kubernetes and container security
Kubernetes and container securityKubernetes and container security
Kubernetes and container security
 
Jenkinsconf Presentation - Advance jenkins management with multiple projects.
Jenkinsconf Presentation - Advance jenkins management with multiple projects.Jenkinsconf Presentation - Advance jenkins management with multiple projects.
Jenkinsconf Presentation - Advance jenkins management with multiple projects.
 
Building a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containersBuilding a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containers
 
Anatomy of a Build Pipeline
Anatomy of a Build PipelineAnatomy of a Build Pipeline
Anatomy of a Build Pipeline
 
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...
 
DevOpsDays Singapore - Continuous Auditing with Compliance as Code
DevOpsDays Singapore - Continuous Auditing with Compliance as CodeDevOpsDays Singapore - Continuous Auditing with Compliance as Code
DevOpsDays Singapore - Continuous Auditing with Compliance as Code
 
Using Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure SecurityUsing Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure Security
 
Continuous deployment-at-flipkart
Continuous deployment-at-flipkartContinuous deployment-at-flipkart
Continuous deployment-at-flipkart
 
System Hardening Using Ansible
System Hardening Using AnsibleSystem Hardening Using Ansible
System Hardening Using Ansible
 
PKI in DevOps: How to Deploy Certificate Automation within CI/CD
PKI in DevOps: How to Deploy Certificate Automation within CI/CDPKI in DevOps: How to Deploy Certificate Automation within CI/CD
PKI in DevOps: How to Deploy Certificate Automation within CI/CD
 
What it feels like to live in a Security Enabled DevOps World
What it feels like to live in a Security Enabled DevOps WorldWhat it feels like to live in a Security Enabled DevOps World
What it feels like to live in a Security Enabled DevOps World
 
Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019
 
Banfootguns devseccon 2019
Banfootguns devseccon 2019Banfootguns devseccon 2019
Banfootguns devseccon 2019
 
Bay Area Chef Meetup February
Bay Area Chef Meetup FebruaryBay Area Chef Meetup February
Bay Area Chef Meetup February
 

Similar to Create Disposable Test Environments with Vagrant and Puppet

DevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantDevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantAntons Kranga
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantBrian Hogan
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for DevelopersJohn Coggeshall
 
Web Technology Management Lecture IV
Web Technology Management Lecture IVWeb Technology Management Lecture IV
Web Technology Management Lecture IVsopekmir
 
Conhecendo o Vagrant
Conhecendo o VagrantConhecendo o Vagrant
Conhecendo o VagrantLeandro Nunes
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for DevelopersJohn Coggeshall
 
Simplify and run your development environments with Vagrant on OpenStack
Simplify and run your development environments with Vagrant on OpenStackSimplify and run your development environments with Vagrant on OpenStack
Simplify and run your development environments with Vagrant on OpenStackB1 Systems GmbH
 
Kubernetes 101 VMworld 2019 workshop slides
Kubernetes 101 VMworld 2019 workshop slidesKubernetes 101 VMworld 2019 workshop slides
Kubernetes 101 VMworld 2019 workshop slidesSimone Morellato
 
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클Oracle Korea
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in developmentAdam Culp
 
Simplify and run your development environments with Vagrant on OpenStack
Simplify and run your development environments with Vagrant on OpenStackSimplify and run your development environments with Vagrant on OpenStack
Simplify and run your development environments with Vagrant on OpenStackB1 Systems GmbH
 
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...Acquia
 
20180607 master your vms with vagrant
20180607 master your vms with vagrant20180607 master your vms with vagrant
20180607 master your vms with vagrantmakker_nl
 
Professional deployment
Professional deploymentProfessional deployment
Professional deploymentIvelina Dimova
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for DevelopersAntons Kranga
 
Jump into Squeak - Integrate Squeak projects with Docker & Github
Jump into Squeak - Integrate Squeak projects with Docker & GithubJump into Squeak - Integrate Squeak projects with Docker & Github
Jump into Squeak - Integrate Squeak projects with Docker & Githubhubx
 

Similar to Create Disposable Test Environments with Vagrant and Puppet (20)

Security Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-CodeSecurity Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-Code
 
DevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantDevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: Vagrant
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with Vagrant
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
Vagrant
VagrantVagrant
Vagrant
 
Vagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy StepsVagrant Up in 5 Easy Steps
Vagrant Up in 5 Easy Steps
 
Web Technology Management Lecture IV
Web Technology Management Lecture IVWeb Technology Management Lecture IV
Web Technology Management Lecture IV
 
Conhecendo o Vagrant
Conhecendo o VagrantConhecendo o Vagrant
Conhecendo o Vagrant
 
Virtualization for Developers
Virtualization for DevelopersVirtualization for Developers
Virtualization for Developers
 
Simplify and run your development environments with Vagrant on OpenStack
Simplify and run your development environments with Vagrant on OpenStackSimplify and run your development environments with Vagrant on OpenStack
Simplify and run your development environments with Vagrant on OpenStack
 
Kubernetes 101 VMworld 2019 workshop slides
Kubernetes 101 VMworld 2019 workshop slidesKubernetes 101 VMworld 2019 workshop slides
Kubernetes 101 VMworld 2019 workshop slides
 
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
[Hands-on 필수 준비 사항] 쇼핑몰 예제를 통한 Microservice 개발/배포 실습 - 황주필 부장 / 강인호 부장, 한국오라클
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in development
 
Intro to vagrant
Intro to vagrantIntro to vagrant
Intro to vagrant
 
Simplify and run your development environments with Vagrant on OpenStack
Simplify and run your development environments with Vagrant on OpenStackSimplify and run your development environments with Vagrant on OpenStack
Simplify and run your development environments with Vagrant on OpenStack
 
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
 
20180607 master your vms with vagrant
20180607 master your vms with vagrant20180607 master your vms with vagrant
20180607 master your vms with vagrant
 
Professional deployment
Professional deploymentProfessional deployment
Professional deployment
 
Vagrant introduction for Developers
Vagrant introduction for DevelopersVagrant introduction for Developers
Vagrant introduction for Developers
 
Jump into Squeak - Integrate Squeak projects with Docker & Github
Jump into Squeak - Integrate Squeak projects with Docker & GithubJump into Squeak - Integrate Squeak projects with Docker & Github
Jump into Squeak - Integrate Squeak projects with Docker & Github
 

More from Coveros, Inc.

Which Development Metrics Should I Watch?
Which Development Metrics Should I Watch?Which Development Metrics Should I Watch?
Which Development Metrics Should I Watch?Coveros, Inc.
 
10 Things You Might Not Know: Continuous Integration
10 Things You Might Not Know: Continuous Integration10 Things You Might Not Know: Continuous Integration
10 Things You Might Not Know: Continuous IntegrationCoveros, Inc.
 
Increasing Quality with DevOps
Increasing Quality with DevOpsIncreasing Quality with DevOps
Increasing Quality with DevOpsCoveros, Inc.
 
Building Security in Using CI
Building Security in Using CIBuilding Security in Using CI
Building Security in Using CICoveros, Inc.
 
Better Security Testing: Using the Cloud and Continuous Delivery
Better Security Testing: Using the Cloud and Continuous Delivery Better Security Testing: Using the Cloud and Continuous Delivery
Better Security Testing: Using the Cloud and Continuous Delivery Coveros, Inc.
 
Continuous Delivery in a Legacy Shop - One Step at a Time
Continuous Delivery in a Legacy Shop - One Step at a Time Continuous Delivery in a Legacy Shop - One Step at a Time
Continuous Delivery in a Legacy Shop - One Step at a Time Coveros, Inc.
 
DevOps in a Regulated and Embedded Environment (AgileDC)
DevOps in a Regulated and Embedded Environment (AgileDC) DevOps in a Regulated and Embedded Environment (AgileDC)
DevOps in a Regulated and Embedded Environment (AgileDC) Coveros, Inc.
 
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...Coveros, Inc.
 
Tests Your Pipeline Might Be Missing
 Tests Your Pipeline Might Be Missing Tests Your Pipeline Might Be Missing
Tests Your Pipeline Might Be MissingCoveros, Inc.
 
Testing in a Continuous Delivery Pipeline - Better, Faster, Cheaper
Testing in a Continuous Delivery Pipeline - Better, Faster, Cheaper Testing in a Continuous Delivery Pipeline - Better, Faster, Cheaper
Testing in a Continuous Delivery Pipeline - Better, Faster, Cheaper Coveros, Inc.
 
Web Application Security Testing: Kali Linux Is the Way to Go
Web Application Security Testing: Kali Linux Is the Way to Go Web Application Security Testing: Kali Linux Is the Way to Go
Web Application Security Testing: Kali Linux Is the Way to Go Coveros, Inc.
 

More from Coveros, Inc. (11)

Which Development Metrics Should I Watch?
Which Development Metrics Should I Watch?Which Development Metrics Should I Watch?
Which Development Metrics Should I Watch?
 
10 Things You Might Not Know: Continuous Integration
10 Things You Might Not Know: Continuous Integration10 Things You Might Not Know: Continuous Integration
10 Things You Might Not Know: Continuous Integration
 
Increasing Quality with DevOps
Increasing Quality with DevOpsIncreasing Quality with DevOps
Increasing Quality with DevOps
 
Building Security in Using CI
Building Security in Using CIBuilding Security in Using CI
Building Security in Using CI
 
Better Security Testing: Using the Cloud and Continuous Delivery
Better Security Testing: Using the Cloud and Continuous Delivery Better Security Testing: Using the Cloud and Continuous Delivery
Better Security Testing: Using the Cloud and Continuous Delivery
 
Continuous Delivery in a Legacy Shop - One Step at a Time
Continuous Delivery in a Legacy Shop - One Step at a Time Continuous Delivery in a Legacy Shop - One Step at a Time
Continuous Delivery in a Legacy Shop - One Step at a Time
 
DevOps in a Regulated and Embedded Environment (AgileDC)
DevOps in a Regulated and Embedded Environment (AgileDC) DevOps in a Regulated and Embedded Environment (AgileDC)
DevOps in a Regulated and Embedded Environment (AgileDC)
 
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...
Compatibility Testing of Your Web Apps - Tips and Tricks for Debugging Locall...
 
Tests Your Pipeline Might Be Missing
 Tests Your Pipeline Might Be Missing Tests Your Pipeline Might Be Missing
Tests Your Pipeline Might Be Missing
 
Testing in a Continuous Delivery Pipeline - Better, Faster, Cheaper
Testing in a Continuous Delivery Pipeline - Better, Faster, Cheaper Testing in a Continuous Delivery Pipeline - Better, Faster, Cheaper
Testing in a Continuous Delivery Pipeline - Better, Faster, Cheaper
 
Web Application Security Testing: Kali Linux Is the Way to Go
Web Application Security Testing: Kali Linux Is the Way to Go Web Application Security Testing: Kali Linux Is the Way to Go
Web Application Security Testing: Kali Linux Is the Way to Go
 

Recently uploaded

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 

Recently uploaded (20)

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 

Create Disposable Test Environments with Vagrant and Puppet

  • 1. © Copyright 2015 Coveros, Inc. All rights reserved. Creating Disposable Test Environments with Vagrant and Puppet Gene Gotimer, Senior Architect gene.gotimer@coveros.com
  • 2. 2© Copyright 2015 Coveros, Inc. All rights reserved.  Coveros helps organizations accelerate the delivery of business value through secure, reliable software About Coveros
  • 3. 3© Copyright 2015 Coveros, Inc. All rights reserved. Why Disposable Test Environments?  Destructive testing  Known baseline  Available on-demand  Not shared  No vested interest in keeping them long-term  Always up-to-date
  • 4. 4© Copyright 2015 Coveros, Inc. All rights reserved. Tools Involved  VirtualBox – virtualization software  Vagrant – virtualization automation  Puppet – configuration management and automation – Chef, Ansible, or SaltStack would work equally well  Packer – machine image automation
  • 5. 5© Copyright 2015 Coveros, Inc. All rights reserved. VirtualBox
  • 6. 6© Copyright 2015 Coveros, Inc. All rights reserved. Oracle VM VirtualBox  Virtualization software from Oracle  Free  Runs on Windows, Mac, Linux  Runs as an application  Allows us to use local VMs  Easy to install  Works well with Vagrant https://www.virtualbox.org/
  • 7. 7© Copyright 2015 Coveros, Inc. All rights reserved. Vagrant
  • 8. 8© Copyright 2015 Coveros, Inc. All rights reserved. Vagrant  Virtualization workflow software from HashiCorp  Free, open-source  Runs on Windows, Mac, Linux  Easy to install  Works well with Puppet, Chef, Shell – many other provisioners  Works well with VirtualBox, VMware, Amazon Web Services – many other providers https://www.vagrantup.com/
  • 9. 9© Copyright 2015 Coveros, Inc. All rights reserved. Creating a Vagrant Box  To create a VM: – mkdir starcanada‐vagrant – cd starcanada‐vagrant – vagrant box add hashicorp/precise64 – vagrant init hashicorp/precise64 – vagrant up  vagrant box add – downloads a “base box” – boxes at https://atlas.hashicorp.com/search  vagrant init – builds a Vagrantfile with the base box  vagrant up – starts the VM
  • 10. 10© Copyright 2015 Coveros, Inc. All rights reserved. Vagrantfile  Vagrantfile – lots of comments by default – stock Vagrantfile without comments is: Vagrant.configure(2) do |config| config.vm.box = "hashicorp/precise64" end
  • 11. 11© Copyright 2015 Coveros, Inc. All rights reserved. vagrant up  vagrant up – imports the base box to VirtualBox – makes sure the base box is up to date – sets a unique name for the VM – sets up networking (just NAT by default) – sets up port forwarding (just SSH by default) – boots VM – replaces known, insecure SSH key with a new random key – makes sure VirtualBox Guest Additions are installed – mounts shared folders (/vagrant by default on the VM) – provisions software (nothing by default)
  • 12. 12© Copyright 2015 Coveros, Inc. All rights reserved. Access Vagrant Box  To access a VM: – vagrant ssh  vagrant ssh – connects to the VM via the forwarded SSH port  requires an SSH client installed – Git (https://msysgit.github.io/) – openssh on Cygwin (http://www.cygwin.com/) – PuTTY (http://www.chiark.greenend.org.uk/~sgtatham/putty/)  requires converting the key format
  • 13. 13© Copyright 2015 Coveros, Inc. All rights reserved. Rebuild Vagrant Box  To rebuild a VM: – vagrant destroy – vagrant up  vagrant destroy – deletes a VM  vagrant up – starts the VM
  • 14. 14© Copyright 2015 Coveros, Inc. All rights reserved. Puppet
  • 15. 15© Copyright 2015 Coveros, Inc. All rights reserved. Puppet  Configuration management software from PuppetLabs  Vaguely Ruby-based, domain-specific language  Free, open-source  Runs on Windows, Mac, Linux  Easy to install  Works well with Vagrant  Similar to Chef, Ansible, SaltStack https://puppetlabs.com/
  • 16. 16© Copyright 2015 Coveros, Inc. All rights reserved. Install Apache with Puppet  Modify the Vagrantfile: Vagrant.configure(2) do |config| config.vm.box = "hashicorp/precise64" config.vm.network "private_network", ip: "192.168.33.10" config.puppet_install.puppet_version = '3.8.1' config.vm.provision "shell", inline: <<‐SHELL sudo puppet module install puppetlabs‐apache SHELL config.vm.provision "puppet" do |puppet| puppet.manifests_path = "manifests" puppet.manifest_file = "site.pp" puppet.module_path = "modules" end end
  • 17. 17© Copyright 2015 Coveros, Inc. All rights reserved. Vagrant Networking  config.vm.network "private_network", ip: "192.168.33.10" – sets up a new network interface on the box – private_network = host-only  only this box and other VMs on this box can reach it
  • 18. 18© Copyright 2015 Coveros, Inc. All rights reserved. Vagrant Modules  config.puppet_install.puppet_version = '3.8.1' – Vagrant module from https://github.com/mitchellh/vagrant/wiki/Available-Vagrant-Plugins – vagrant‐puppet‐install  installs Puppet version 3.8.1  could have been :latest, but I want control
  • 19. 19© Copyright 2015 Coveros, Inc. All rights reserved. Shell Provisioning  config.vm.provision "shell", inline: <<‐SHELL sudo puppet module install puppetlabs‐apache SHELL – here-doc that runs all the commands until SHELL – this command installs a Puppet module from https://forge.puppetlabs.com/puppetlabs
  • 20. 20© Copyright 2015 Coveros, Inc. All rights reserved. Puppet Provisioning  config.vm.provision "puppet" do |puppet| puppet.manifests_path = "manifests" puppet.manifest_file = "site.pp" puppet.module_path = "modules" end – sets up a standard Puppet layout – commands in manifests/site.pp – reusable modules in modules
  • 21. 21© Copyright 2015 Coveros, Inc. All rights reserved. Example Puppet Code  Example init.pp file in the modules/website/manifests directory: class website { class { 'apache': } apache::vhost { "${::fqdn}": vhost_name => '*', default_vhost => true, port          => '80', docroot => '/var/www', } file { '/var/www/index.html': ensure  => 'file', content => template('website/index.html.erb'), owner   => 'root', group   => 'www‐data', mode    => '0640', require => Class['apache'], } }
  • 22. 22© Copyright 2015 Coveros, Inc. All rights reserved. Installing Apache httpd  class { 'apache:' }  – installs Apache httpd server – sets up default configuration
  • 23. 23© Copyright 2015 Coveros, Inc. All rights reserved. Configuring Apache httpd  apache::vhost { "${::fqdn}": vhost_name => '*', default_vhost => true, port          => '80', docroot => '/var/www', } – sets up default virtual host – listening on port 80 – document root is /var/www
  • 24. 24© Copyright 2015 Coveros, Inc. All rights reserved. Installing Templated Content  file { '/var/www/index.html': ensure  => 'file', content => template('website/index.html.erb'), owner   => 'root', group   => 'www‐data', mode    => '0640', require => Class['apache'], } – copies file from host box – sets owner, group, and permissions
  • 25. 25© Copyright 2015 Coveros, Inc. All rights reserved. Automation Advantages  Deploy is now automated  Automated = repeatable, easy, quick  Test on the system, make any changes we want, then destroy it, recreate it in a pristine condition  Reuse the deployment scripts in all environments – including production – especially production
  • 26. 26© Copyright 2015 Coveros, Inc. All rights reserved. Other Possibilities  Template files  Variable substitution/Configuration database – YAML – JSON – Encrypted  Multiple machines  Different providers – Managed – VMware – Amazon Web Services (AWS)  Chef, Ansible, or SaltStack
  • 27. 27© Copyright 2015 Coveros, Inc. All rights reserved. Packer
  • 28. 28© Copyright 2015 Coveros, Inc. All rights reserved. Packer  Machine image automation from HashiCorp  Free, open-source  Runs on Windows, Mac, Linux  Easy to install  Works well with Puppet, Chef, Shell – many other provisioners  Works well with VirtualBox, VMware, Amazon Web Services – many other providers https://packer.io/
  • 29. 29© Copyright 2015 Coveros, Inc. All rights reserved. Packer Templates  Packer templates on GitHub from Shiguredo, Inc.  Templates for – CentOS Linux 6.4, 6.5, 6.6, 7.0, 7.1 – Scientific Linux 6.4, 6.5, 7.0 – Ubuntu Linux 12.04, 14.04  Fork and edit to create you own base boxes https://github.com/shiguredo/packer-templates
  • 30. 30© Copyright 2015 Coveros, Inc. All rights reserved. Wrap-Up
  • 31. 31© Copyright 2015 Coveros, Inc. All rights reserved. Tools Recap  VirtualBox – virtualization software – https://www.virtualbox.org/  Vagrant – virtualization automation – https://www.vagrantup.com/ – Boxes: https://atlas.hashicorp.com/search – Plugins: https://github.com/mitchellh/vagrant/wiki/Available- Vagrant-Plugins
  • 32. 32© Copyright 2015 Coveros, Inc. All rights reserved. Tools Recap  Puppet – configuration management and automation – https://puppetlabs.com/ – Modules: https://forge.puppetlabs.com/puppetlabs  Packer – machine image automation – https://packer.io/ – Templates: https://github.com/shiguredo/packer- templates
  • 33. 33© Copyright 2015 Coveros, Inc. All rights reserved. Questions? Gene Gotimer gene.gotimer@coveros.com http://www.coveros.com @CoverosGene