SlideShare a Scribd company logo
Puppet and Vagrant in Development




   View details and rate at https://joind.in/6709
Puppet and Vagrant in Development

   Puppet is:
       Automation software to      help   system   admins
        manage infrastructure.
       Automates provisioning and configuration
       Automate repetitive tasks
       Ensure stability through consistency
       Open source and commercial versions
Puppet and Vagrant in Development

   Puppet Components:
       Puppet Master
       Puppet Agent
       Puppet Enterprise Console (not in open source)
       Puppet Module Tool
       Puppet Compliance
       Mcollective
       Facter
Puppet and Vagrant in Development

   Third-party Product Needs:
       Ruby
       Apache HTTP server
       Phusion Passenger
       ActiveMQ
       Ruby on Rails
Puppet and Vagrant in Development

   Supported Operating Systems:
       RHEL
       CentOS
       Ubuntu
       Debian
       Scientific Linux
       Oracle Linux
       SUSE
       Solaris
       Windows
Puppet and Vagrant in Development
   Pieces
       Modules for
        popular
        configurations
       Compose
        application stack
        needed
       Rollout to the
        node
Puppet and Vagrant in Development
   Workflow
       Node informs Puppet Master of status
       Puppet Master compiles a catalog
       Node complies with catalog
       Puppet Agent on client reports back to Puppet
        Master
       Puppet Master reports to Report Collector.
Puppet and Vagrant in Development
Puppet and Vagrant in Development
   Sample Usages
       Roll out another node in a cluster
                   Webserver
                   Email server
                   Database server
                   Etc.
       Add another workstation
       Create lifecycle machine
                   Development
                   Testing
                   Staging
                   Production
Puppet and Vagrant in Development
   Puppet Resources
       Puppet defines resources in a array'ish language
User { 'dave':
    Ensure => present,
    uid => '507',
    gid => 'admin',
    shell => '/bin/zsh',
    home => '/home/dave',
    managehome => true,
}

       We can see the parts of the structure
                   Type = User
                   Title = Dave
                   Attributes
                   Values
Puppet and Vagrant in Development
   Puppet Adding a Resources
       What does it look like:
$ puppet resource user dave ensure=present shell=”/bin/zsh”
home=”/home/dave” managehome=true
       Would output:
Notice: /User[dave]/ensure: created
User { 'dave':
    Ensure => present,
    uid => '507',
    gid => 'admin',
    shell => '/bin/zsh',
    home => '/home/dave',
    managehome => true,
}
Puppet and Vagrant in Development
   Puppet Manifests
       Can inform Puppet what to do in bulk using
        manifests.
$ puppet apply my_test_manifest.pp

       Manifest would look like:
# /path/to/my_test_manifest.pp
User { 'dave':
    Ensure => present,
    uid => '507',
    gid => 'admin',
    shell => '/bin/zsh',
    home => '/home/dave',
    managehome => true,
}
Puppet and Vagrant in Development
   Puppet Manifest Classes
       The Puppet manifests can become complex.
Class ntp {
    package { 'ntp':
        ensure => installed,
    }

    service { 'ntp':
        name => 'ntpd',
        ensure => running,
        enable => true,
        subscribe => File['ntp.conf'],
    }
}
Puppet and Vagrant in Development
   Puppet Training
       Materials available on PuppetLabs site for FREE
        download.
                  Learning Puppet Tutorial
                  Learn Puppet VM to train on (VMWare or
                    VirtualBox)
                  Module cheatsheet
                  Core types cheatsheet
                  Users Guide
                  Dashboard Manual
Puppet and Vagrant in Development
   Provisioned Your Way
       VirtualBox – through 3rd party
       VMWare – direct Puppet support
       Cloud – direct Puppet support
       Traditional hardware - standard
Puppet and Vagrant in Development
   Vagrant
       Virtualized development made easy
                  Lowers setup time
                  Eliminates “works on my machine” excuse
                  Uses Oracle VirtualBox
                  Can use Puppet or Chef
                  FREE and open source
Puppet and Vagrant in Development
   Vagrant setup items needed for this example
       Get VirtualBox from Oracle's download page
       Install Ruby
                   Required by Vagrant, Chef and/or Puppet.
       Install Vagrant
                   Talks to VirtualBox and builds virtual machine
                     based on a “base box”.
       Decide on whether to use Chef or Puppet.
                   Enables setup and configuration of advanced
                     services you may need in your environment.
Puppet and Vagrant in Development
   Vagrant Basic How To
       Create a directory and change to the new directory
        via command line.
       Execute three simple commands:
$ vagrant box add lucid32 http://files.vagrantup.com/lucid32.box
$ vagrant init lucid32
$ vagrant up

       We now have a working Ubuntu (Lucid Lynx 32 bit)
        linux server running. However it is very “bare
        bones”.
       List installed Boxes
$ vagrant box list
Puppet and Vagrant in Development
   Benefits of Using Vagrant
       Solo Developers
                   Maintain consistency across multiple projects.
                   Run multiple environments on a single home
                     machine. (Dev., Test, Staging)
                   Easily tear down and rebuild
       Teams
                   Identical development environments. Consistent
                      and portable.
       Companies
                   Easier onboarding of new talent.
                   Build development environment      once   and
                     distribute to teams.
Puppet and Vagrant in Development
   Vagrant Configuration
       Vagrantfile
                  Simply Ruby code which typically contains a
                    Vagrant configuration block.
                  First thing loaded by Vagrant.
                  Basic file created when 'init' is called from within
                    a directory.
                  Add more options for more configuration.
Puppet and Vagrant in Development
   Vagrant Base Box
       Many base boxes available over the Internet, or you
        can create your own.
                Creation convention should be followed
       A base box must be added via local file or HTTP
$ vagrant box add {name} {location to pull from}

       Or you can remove current base boxes
$ vagrant box remove {name}

       Base box is defined in the Vagrantfile
Vagrant::Config.run do |config|
    config.vm.box = “lucid32”
end
Puppet and Vagrant in Development
   Testing/Running
       To launch the bootup/provision we simply tell
        Vagrant “up”.
$ vagrant up

       Or if you “suspended” to shut down last time you
        would use “resume”.
       To shut down we can either “suspend” to save the
        current state of the machine (does not return disk
        space, about 1GB), “destroy” everything (requires
        re-provision), or “halt” which is a graceful
        shutdown.
$ vagrant destroy
$ vagrant halt
Puppet and Vagrant in Development
   SSH
       Vagrant makes SSH easy to the virtual machine
        from within the project directory.
$ vagrant ssh

       Project files are available at '/vagrant' by default,
        but can be changed.
       The VM has both read and write access to the
        shared folder.
       To gain root (su) access the password is 'vagrant'
Puppet and Vagrant in Development
   Provisioning
       Using Chef or Puppet we can create a manifest to
        alter the VM.
                 Install apps
                 Edit config files


                 Many tasks needed to go from Base Box

                    to desired environment.
       Manifests (or recipe for Chef)
                  Manifests sub-directory within project.
                  Default.pp is the default file loaded.
Puppet and Vagrant in Development
   Port Forwarding
       By default your host machine should be able to
        access the virtual machine by IP address. However,
        we need to activate port forwarding for services.
       For HTTP:
Vagrant::Config.run do |config|
    # Forward guest port 80 to host port 4567
    config.vm.forward_port 80, 4567
end

       Then we simply reload Vagrant.
$ vagrant reload
Puppet and Vagrant in Development
   Packaging
       Start with a Base Box
                   Customize it as needed, unless relying solely on
                     provisioning with Chef or Puppet.
                   Run command to package
$ vagrant package –vagrantfile Vagrantfile.pkg
                   Creates 'package.box' in same directory.
                   Distribute via raw file or via HTTP, for others.
                   Other users can now use:
$ vagrant box add my_box /path/to/the/package.box
$ vagrant init my_box
$ vagrant up
Puppet and Vagrant in Development
   Advanced Capabilities of Vagrant
       Many   advanced      topics     available   under
        Documentation on the Vagrant site.
                  Modules within Manifests to encapsulate
                    Puppet files.
                  Create your own Base Boxes
                  Multi-VM Environment
                  Plugins
                  NFS Shared Folders
Puppet and Vagrant in Development
   Resources
       http://vagrantup.com
       http://puppetlabs.com
       http://opscode.com/chef/
       http://virtualbox.org



         View details and rate at https://joind.in/6709
Puppet and Vagrant in Development

   Thank you


                   Adam Culp
            http://www.geekyboy.com
           http://github.com/adamculp
                Twitter @adamculp

More Related Content

What's hot (20)

PDF
A Hands-on Introduction to Docker
CodeOps Technologies LLP
 
PDF
Docker - From Walking To Running
Giacomo Vacca
 
PDF
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Erica Windisch
 
PPTX
How To Set a Vagrant Development System
Paul Bearne
 
PDF
The state of the swarm
Mathieu Buffenoir
 
PDF
Tech Talk - Vagrant
Thomas Krille
 
PPTX
Learn docker in 90 minutes
Larry Cai
 
PDF
Docker 101 - from 0 to Docker in 30 minutes
Luciano Fiandesio
 
PDF
Docker
Chen Chun
 
PDF
Docker by Example - Basics
Ganesh Samarthyam
 
PDF
Using Docker with Puppet - PuppetConf 2014
Puppet
 
ODP
Docker - The Linux Container
Balaji Rajan
 
PPTX
Docker Introductory workshop
Runcy Oommen
 
PDF
Docker and Containers for Development and Deployment — SCALE12X
Jérôme Petazzoni
 
PPTX
Docker orchestration
Open Source Consulting
 
PDF
From development environments to production deployments with Docker, Compose,...
Jérôme Petazzoni
 
PDF
Docker by Example - Basics
CodeOps Technologies LLP
 
PDF
Introduction to Docker and deployment and Azure
Jérôme Petazzoni
 
PPTX
Vagrant vs Docker
jchase50
 
PDF
Docker by Example - Quiz
CodeOps Technologies LLP
 
A Hands-on Introduction to Docker
CodeOps Technologies LLP
 
Docker - From Walking To Running
Giacomo Vacca
 
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Erica Windisch
 
How To Set a Vagrant Development System
Paul Bearne
 
The state of the swarm
Mathieu Buffenoir
 
Tech Talk - Vagrant
Thomas Krille
 
Learn docker in 90 minutes
Larry Cai
 
Docker 101 - from 0 to Docker in 30 minutes
Luciano Fiandesio
 
Docker
Chen Chun
 
Docker by Example - Basics
Ganesh Samarthyam
 
Using Docker with Puppet - PuppetConf 2014
Puppet
 
Docker - The Linux Container
Balaji Rajan
 
Docker Introductory workshop
Runcy Oommen
 
Docker and Containers for Development and Deployment — SCALE12X
Jérôme Petazzoni
 
Docker orchestration
Open Source Consulting
 
From development environments to production deployments with Docker, Compose,...
Jérôme Petazzoni
 
Docker by Example - Basics
CodeOps Technologies LLP
 
Introduction to Docker and deployment and Azure
Jérôme Petazzoni
 
Vagrant vs Docker
jchase50
 
Docker by Example - Quiz
CodeOps Technologies LLP
 

Similar to Puppet and Vagrant in development (20)

PDF
Security Testing Using Infrastructure-As-Code
Vision Concepts Infrastructure Services Solution
 
PDF
Instant LAMP Stack with Vagrant and Puppet
Patrick Lee
 
PDF
Using Vagrant, Puppet, Testing & Hadoop
Puppet
 
PDF
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
OlinData
 
PDF
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
Walter Heck
 
PPTX
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
Acquia
 
PPTX
Virtualization for Developers
John Coggeshall
 
ODP
Vagrant and puppet: Deployment made easy
Geronimo Orozco
 
PDF
Vagrant for Virtualized Development
Adam Culp
 
PDF
Virtualization with Vagrant (ua.pycon 2011)
Dmitry Guyvoronsky
 
PPTX
Virtualization for Developers
John Coggeshall
 
PDF
Getting started with puppet and vagrant (1)
Puppet
 
PDF
Vagrant-Binding JUG Dortmund
Hendrik Ebbers
 
PPTX
Harmonious Development: Via Vagrant and Puppet
Achieve Internet
 
PDF
Vagrant Binding JayDay 2013
Hendrik Ebbers
 
PDF
Intro to vagrant
Mantas Klasavicius
 
PDF
Vagrant - Team Development made easy
Marco Silva
 
PDF
Keep calm and vagrant up
Daniel Carvalhinho
 
PDF
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
Hendrik Ebbers
 
PDF
From Dev to DevOps
Agile Spain
 
Security Testing Using Infrastructure-As-Code
Vision Concepts Infrastructure Services Solution
 
Instant LAMP Stack with Vagrant and Puppet
Patrick Lee
 
Using Vagrant, Puppet, Testing & Hadoop
Puppet
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
OlinData
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
Walter Heck
 
Harmonious Development: Standardizing The Deployment Process via Vagrant and ...
Acquia
 
Virtualization for Developers
John Coggeshall
 
Vagrant and puppet: Deployment made easy
Geronimo Orozco
 
Vagrant for Virtualized Development
Adam Culp
 
Virtualization with Vagrant (ua.pycon 2011)
Dmitry Guyvoronsky
 
Virtualization for Developers
John Coggeshall
 
Getting started with puppet and vagrant (1)
Puppet
 
Vagrant-Binding JUG Dortmund
Hendrik Ebbers
 
Harmonious Development: Via Vagrant and Puppet
Achieve Internet
 
Vagrant Binding JayDay 2013
Hendrik Ebbers
 
Intro to vagrant
Mantas Klasavicius
 
Vagrant - Team Development made easy
Marco Silva
 
Keep calm and vagrant up
Daniel Carvalhinho
 
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
Hendrik Ebbers
 
From Dev to DevOps
Agile Spain
 
Ad

More from Adam Culp (20)

PDF
Hypermedia
Adam Culp
 
PDF
Putting legacy to REST with middleware
Adam Culp
 
PDF
php-1701-a
Adam Culp
 
PDF
Release your refactoring superpower
Adam Culp
 
PDF
Managing Technical Debt
Adam Culp
 
PDF
Developing PHP Applications Faster
Adam Culp
 
PDF
Containing Quality
Adam Culp
 
PDF
Debugging elephpants
Adam Culp
 
PDF
Zend expressive workshop
Adam Culp
 
PDF
Expressive Microservice Framework Blastoff
Adam Culp
 
PDF
Foundations of Zend Framework
Adam Culp
 
PDF
Accidental professional
Adam Culp
 
PDF
Build great products
Adam Culp
 
PDF
Does Your Code Measure Up?
Adam Culp
 
PDF
Practical PHP Deployment with Jenkins
Adam Culp
 
PDF
Virtualizing Development
Adam Culp
 
PDF
Refactoring Legacy Code
Adam Culp
 
PDF
Deprecated: Foundations of Zend Framework 2
Adam Culp
 
PDF
Clean application development tutorial
Adam Culp
 
PDF
Refactoring 101
Adam Culp
 
Hypermedia
Adam Culp
 
Putting legacy to REST with middleware
Adam Culp
 
php-1701-a
Adam Culp
 
Release your refactoring superpower
Adam Culp
 
Managing Technical Debt
Adam Culp
 
Developing PHP Applications Faster
Adam Culp
 
Containing Quality
Adam Culp
 
Debugging elephpants
Adam Culp
 
Zend expressive workshop
Adam Culp
 
Expressive Microservice Framework Blastoff
Adam Culp
 
Foundations of Zend Framework
Adam Culp
 
Accidental professional
Adam Culp
 
Build great products
Adam Culp
 
Does Your Code Measure Up?
Adam Culp
 
Practical PHP Deployment with Jenkins
Adam Culp
 
Virtualizing Development
Adam Culp
 
Refactoring Legacy Code
Adam Culp
 
Deprecated: Foundations of Zend Framework 2
Adam Culp
 
Clean application development tutorial
Adam Culp
 
Refactoring 101
Adam Culp
 
Ad

Recently uploaded (20)

PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PDF
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
July Patch Tuesday
Ivanti
 
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 

Puppet and Vagrant in development

  • 1. Puppet and Vagrant in Development View details and rate at https://joind.in/6709
  • 2. Puppet and Vagrant in Development  Puppet is:  Automation software to help system admins manage infrastructure.  Automates provisioning and configuration  Automate repetitive tasks  Ensure stability through consistency  Open source and commercial versions
  • 3. Puppet and Vagrant in Development  Puppet Components:  Puppet Master  Puppet Agent  Puppet Enterprise Console (not in open source)  Puppet Module Tool  Puppet Compliance  Mcollective  Facter
  • 4. Puppet and Vagrant in Development  Third-party Product Needs:  Ruby  Apache HTTP server  Phusion Passenger  ActiveMQ  Ruby on Rails
  • 5. Puppet and Vagrant in Development  Supported Operating Systems:  RHEL  CentOS  Ubuntu  Debian  Scientific Linux  Oracle Linux  SUSE  Solaris  Windows
  • 6. Puppet and Vagrant in Development  Pieces  Modules for popular configurations  Compose application stack needed  Rollout to the node
  • 7. Puppet and Vagrant in Development  Workflow  Node informs Puppet Master of status  Puppet Master compiles a catalog  Node complies with catalog  Puppet Agent on client reports back to Puppet Master  Puppet Master reports to Report Collector.
  • 8. Puppet and Vagrant in Development
  • 9. Puppet and Vagrant in Development  Sample Usages  Roll out another node in a cluster  Webserver  Email server  Database server  Etc.  Add another workstation  Create lifecycle machine  Development  Testing  Staging  Production
  • 10. Puppet and Vagrant in Development  Puppet Resources  Puppet defines resources in a array'ish language User { 'dave': Ensure => present, uid => '507', gid => 'admin', shell => '/bin/zsh', home => '/home/dave', managehome => true, }  We can see the parts of the structure  Type = User  Title = Dave  Attributes  Values
  • 11. Puppet and Vagrant in Development  Puppet Adding a Resources  What does it look like: $ puppet resource user dave ensure=present shell=”/bin/zsh” home=”/home/dave” managehome=true  Would output: Notice: /User[dave]/ensure: created User { 'dave': Ensure => present, uid => '507', gid => 'admin', shell => '/bin/zsh', home => '/home/dave', managehome => true, }
  • 12. Puppet and Vagrant in Development  Puppet Manifests  Can inform Puppet what to do in bulk using manifests. $ puppet apply my_test_manifest.pp  Manifest would look like: # /path/to/my_test_manifest.pp User { 'dave': Ensure => present, uid => '507', gid => 'admin', shell => '/bin/zsh', home => '/home/dave', managehome => true, }
  • 13. Puppet and Vagrant in Development  Puppet Manifest Classes  The Puppet manifests can become complex. Class ntp { package { 'ntp': ensure => installed, } service { 'ntp': name => 'ntpd', ensure => running, enable => true, subscribe => File['ntp.conf'], } }
  • 14. Puppet and Vagrant in Development  Puppet Training  Materials available on PuppetLabs site for FREE download.  Learning Puppet Tutorial  Learn Puppet VM to train on (VMWare or VirtualBox)  Module cheatsheet  Core types cheatsheet  Users Guide  Dashboard Manual
  • 15. Puppet and Vagrant in Development  Provisioned Your Way  VirtualBox – through 3rd party  VMWare – direct Puppet support  Cloud – direct Puppet support  Traditional hardware - standard
  • 16. Puppet and Vagrant in Development  Vagrant  Virtualized development made easy  Lowers setup time  Eliminates “works on my machine” excuse  Uses Oracle VirtualBox  Can use Puppet or Chef  FREE and open source
  • 17. Puppet and Vagrant in Development  Vagrant setup items needed for this example  Get VirtualBox from Oracle's download page  Install Ruby  Required by Vagrant, Chef and/or Puppet.  Install Vagrant  Talks to VirtualBox and builds virtual machine based on a “base box”.  Decide on whether to use Chef or Puppet.  Enables setup and configuration of advanced services you may need in your environment.
  • 18. Puppet and Vagrant in Development  Vagrant Basic How To  Create a directory and change to the new directory via command line.  Execute three simple commands: $ vagrant box add lucid32 http://files.vagrantup.com/lucid32.box $ vagrant init lucid32 $ vagrant up  We now have a working Ubuntu (Lucid Lynx 32 bit) linux server running. However it is very “bare bones”.  List installed Boxes $ vagrant box list
  • 19. Puppet and Vagrant in Development  Benefits of Using Vagrant  Solo Developers  Maintain consistency across multiple projects.  Run multiple environments on a single home machine. (Dev., Test, Staging)  Easily tear down and rebuild  Teams  Identical development environments. Consistent and portable.  Companies  Easier onboarding of new talent.  Build development environment once and distribute to teams.
  • 20. Puppet and Vagrant in Development  Vagrant Configuration  Vagrantfile  Simply Ruby code which typically contains a Vagrant configuration block.  First thing loaded by Vagrant.  Basic file created when 'init' is called from within a directory.  Add more options for more configuration.
  • 21. Puppet and Vagrant in Development  Vagrant Base Box  Many base boxes available over the Internet, or you can create your own. Creation convention should be followed  A base box must be added via local file or HTTP $ vagrant box add {name} {location to pull from}  Or you can remove current base boxes $ vagrant box remove {name}  Base box is defined in the Vagrantfile Vagrant::Config.run do |config| config.vm.box = “lucid32” end
  • 22. Puppet and Vagrant in Development  Testing/Running  To launch the bootup/provision we simply tell Vagrant “up”. $ vagrant up  Or if you “suspended” to shut down last time you would use “resume”.  To shut down we can either “suspend” to save the current state of the machine (does not return disk space, about 1GB), “destroy” everything (requires re-provision), or “halt” which is a graceful shutdown. $ vagrant destroy $ vagrant halt
  • 23. Puppet and Vagrant in Development  SSH  Vagrant makes SSH easy to the virtual machine from within the project directory. $ vagrant ssh  Project files are available at '/vagrant' by default, but can be changed.  The VM has both read and write access to the shared folder.  To gain root (su) access the password is 'vagrant'
  • 24. Puppet and Vagrant in Development  Provisioning  Using Chef or Puppet we can create a manifest to alter the VM.  Install apps  Edit config files  Many tasks needed to go from Base Box to desired environment.  Manifests (or recipe for Chef)  Manifests sub-directory within project.  Default.pp is the default file loaded.
  • 25. Puppet and Vagrant in Development  Port Forwarding  By default your host machine should be able to access the virtual machine by IP address. However, we need to activate port forwarding for services.  For HTTP: Vagrant::Config.run do |config| # Forward guest port 80 to host port 4567 config.vm.forward_port 80, 4567 end  Then we simply reload Vagrant. $ vagrant reload
  • 26. Puppet and Vagrant in Development  Packaging  Start with a Base Box  Customize it as needed, unless relying solely on provisioning with Chef or Puppet.  Run command to package $ vagrant package –vagrantfile Vagrantfile.pkg  Creates 'package.box' in same directory.  Distribute via raw file or via HTTP, for others.  Other users can now use: $ vagrant box add my_box /path/to/the/package.box $ vagrant init my_box $ vagrant up
  • 27. Puppet and Vagrant in Development  Advanced Capabilities of Vagrant  Many advanced topics available under Documentation on the Vagrant site.  Modules within Manifests to encapsulate Puppet files.  Create your own Base Boxes  Multi-VM Environment  Plugins  NFS Shared Folders
  • 28. Puppet and Vagrant in Development  Resources  http://vagrantup.com  http://puppetlabs.com  http://opscode.com/chef/  http://virtualbox.org View details and rate at https://joind.in/6709
  • 29. Puppet and Vagrant in Development  Thank you Adam Culp http://www.geekyboy.com http://github.com/adamculp Twitter @adamculp