SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Reproducible and Portable
Work Environments with
Vagrant and Chef
About Me
• 33 years old, almost married
• From Karlsruhe, Germany
• Studied Computer Science
• Hobbies: guitar, climbing,
cycling, travel, photography
• Works in Phnom Penh for 3 months
• Working with TYPO3
Outline
• Motivation
• Introducing Vagrant & Chef

• Vagrant „Hands-On“
• Advanced usage
Motivation
• Internal project
• Estimated development time ~2 years
• Approx. 15 developers
• 2-day sprints, every second week
• 4 developers per sprint
Motivation
Observations
• Setting up dev environment takes > 1 day
– More than ½ of the sprint time!

• Developers spent too much time on setup
• Always needed physical server for testing
Solution: Vagrant Boxes
Provisioning 2 virtual machines...
• ...each with an extended LAMP stack*)

• ...with 4 different projects
takes less than 15 minutes

*) including RabbitMQ, Solr, Git, Composer, tons of PHP modules...
Technological Stack
VirtualBox
Free open source virtualization tool
Chef
Automation tool for
Configuration Management

Vagrant
“Remote control” for VirtualBox
What is Vagrant?
• Building tool for portable work environments
• Tool for distributing work environments
• Written in Ruby
• Open Source
• Build upon well-established tools
Vagrant Components
• Vagrant Box
• Vagrantfile
• Provisioners
• Providers
Vagrant Boxes
• Pre-installed base images
• Used as base layer for all further provisioning
• Many different boxes available online:
The Vagrantfile
• Marks root directory of Vagrant project
• Describes what Vagrant box to use

• Describes settings of box (e.g. network)
• Triggers the provisioning of box (using Chef)
Provisioners
• Configures your Vagrant box by
– Installing packages and software
– Configuration and starting of services

• Multiple provisioners available
• Run once the box is booted
Providers
• Describe in which virtualization environment

to provision your machines
• Multiple providers available
– VirtualBox
– VMWare
– Amazon AWS
What is Chef?
• Configuration Management automation tool
• Written in Ruby

• „Code your desired system state“
• Put system state into version control

• Relies on a client / server architecture
– Or use chef solo without a server
Chef Architecture
Chef Architecture
Using chef-solo
• mount cookbooks directory into your box
config.vm.synced_folder "./chef", "/var/chef"
config.vm.synced_folder "./home", "/var/
vagrant-home"

• run chef-solo in your box
config.vm.provision :shell do |s|
s.inline = "sudo chef-solo -c /var/chef/
solo.rb -j /var/vagrant-home/config.json"
end
The solo.rb File
• Define some paths:
file_cache_path "/var/chef-cache"
cookbook_path ["/var/chef/cookbooks”]
data_bag_path "/var/chef/data_bags"
role_path "/var/chef/roles"
The config.json File
• Define cookbook runlist:
{"run_list" : ["recipe[cookbook_name]"]}

• Further configuration in config.json
overwrites defaults in cookbooks
node['key1']['key2']
Chef Provisioning Alternatives
• Different ways for Chef provisioning
– Mounting Cookbooks and use chef-solo

– Copy Cookbooks into box and use chef-solo
– Use Chef client in box and Chef server
Overview
2

Chef Cookbooks
/home/vagrant/chef

mounted/copied into
OR taken from chef server

Vagrant Box

4

uses
cookbooks
triggers
chef

3

remote
controlls

1
Provisioning Activity

Provisioning Activity
Provision Projects

Configuration
Management
Booting Box
Set up Box

Chef,
Git
Vagrant,
Chef
Vagrant,
VirtualBox
Vagrant
Set Up Box
1. Install VirtualBox & Vagrant
2. Add a box
vagrant box add box_name http://box_url

1. Create a first Vagrantfile
mkdir vagrant
cd vagrant
vagrant init
Set up & Boot the Box
4. Use the box in your Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "box_name"
end

5. Boot your machine
vagrant up

6. ssh into your machine
vagrant ssh
Versioning and Distribution
• Remember: „Everything should be put into
Version Control!“
• Vagrantfile can easily be put into any VCS
• Distributing an environment is as easy as
git clone git@github.com:my/vagrant.git
cd vagrant
vagrant up
Daily Vagrant Usage
• Start the box
vagrant up

• Stop the box
Vagrant halt

• Suspend the box
vagrant suspend

• Resume the box
vagrant resume
Multiple Boxes for Multiple Projects
PROs
- Easy to set up
- Can have different systems in a box

Vagrant Box
Project 1

Vagrant Box
Project 2

CONs
- Have multiple Boxes running at the
same time consumes resources

Vagrant Box
Project 3
Multiple Projects in one Box
PROs
- Less ressources required

Vagrant Box
Project 1
Project 2
Project 3

CONs
- No easy way to set up
- Longer provisioning time
- Bigger boxes
Identical Copy of Server
server is provisioned
using Chef Client

Chef Client

Chef Server

Chef Cookbooks

mounted/copied into
OR taken from chef server
provisioned
using same cookboks

Identical Copy of Server
as Vagrant Box
Vagrant & Chef for CI / CD

• Set up the whole deployment chain locally
• Use tools like Jenkins inside your boxes
• Provision the projects on Jenkins with Chef
DevOps
• Tools like Vagrant and Chef bring Developers
and system operators closer together

• Learn from each other
• Use each other‘s tools for problem solving
Summary
• Vagrant is a great tool for portable boxes
• Chef can help you manage your configuration
• „Infrastructure as Code“
• Same environment on dev and live system
• DevOps brings devs and admins together

Weitere ähnliche Inhalte

Was ist angesagt?

Using Vagrant
Using VagrantUsing Vagrant
Using Vagrantandygale
 
Avoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and VagrantAvoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and Vagrantandygale
 
Testable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and DockerTestable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and DockerMandi Walls
 
Automated Infrastructure and Application Management
Automated Infrastructure and Application ManagementAutomated Infrastructure and Application Management
Automated Infrastructure and Application ManagementClark Everetts
 
CLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with JenkinsCLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with JenkinsZachary Stevens
 
How to Write Chef Cookbook
How to Write Chef CookbookHow to Write Chef Cookbook
How to Write Chef Cookbookdevopsjourney
 
Testing for infra code using test-kitchen,docker,chef
Testing for infra code using  test-kitchen,docker,chefTesting for infra code using  test-kitchen,docker,chef
Testing for infra code using test-kitchen,docker,chefkamalikamj
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chefMukta Aphale
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with ChefJonathan Weiss
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction Robert Reiz
 
Continuous Delivery and Infrastructure as Code
Continuous Delivery and Infrastructure as CodeContinuous Delivery and Infrastructure as Code
Continuous Delivery and Infrastructure as CodeSascha Möllering
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAlberto Molina Coballes
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflowTomas Doran
 
Puppet Development Workflow
Puppet Development WorkflowPuppet Development Workflow
Puppet Development WorkflowJeffery Smith
 
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Software, Inc.
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to ChefKnoldus Inc.
 
Docker Docker Docker Chef
Docker Docker Docker ChefDocker Docker Docker Chef
Docker Docker Docker ChefSean OMeara
 
CI/CD Using Ansible and Jenkins for Infrastructure
CI/CD Using Ansible and Jenkins for InfrastructureCI/CD Using Ansible and Jenkins for Infrastructure
CI/CD Using Ansible and Jenkins for InfrastructureFaisal Shaikh
 

Was ist angesagt? (20)

Using Vagrant
Using VagrantUsing Vagrant
Using Vagrant
 
Avoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and VagrantAvoiding surprises with Chef and Vagrant
Avoiding surprises with Chef and Vagrant
 
Testable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and DockerTestable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and Docker
 
Automated Infrastructure and Application Management
Automated Infrastructure and Application ManagementAutomated Infrastructure and Application Management
Automated Infrastructure and Application Management
 
Vagrant to-aws-flow
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flow
 
CLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with JenkinsCLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with Jenkins
 
How to Write Chef Cookbook
How to Write Chef CookbookHow to Write Chef Cookbook
How to Write Chef Cookbook
 
Testing for infra code using test-kitchen,docker,chef
Testing for infra code using  test-kitchen,docker,chefTesting for infra code using  test-kitchen,docker,chef
Testing for infra code using test-kitchen,docker,chef
 
Baking docker using chef
Baking docker using chefBaking docker using chef
Baking docker using chef
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
Continuous Delivery and Infrastructure as Code
Continuous Delivery and Infrastructure as CodeContinuous Delivery and Infrastructure as Code
Continuous Delivery and Infrastructure as Code
 
Automated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. AnsibleAutomated Deployment and Configuration Engines. Ansible
Automated Deployment and Configuration Engines. Ansible
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflow
 
Puppet Development Workflow
Puppet Development WorkflowPuppet Development Workflow
Puppet Development Workflow
 
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of Chef
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
Docker Docker Docker Chef
Docker Docker Docker ChefDocker Docker Docker Chef
Docker Docker Docker Chef
 
CI/CD Using Ansible and Jenkins for Infrastructure
CI/CD Using Ansible and Jenkins for InfrastructureCI/CD Using Ansible and Jenkins for Infrastructure
CI/CD Using Ansible and Jenkins for Infrastructure
 

Ähnlich wie Vagrant and Chef on FOSSASIA 2014

Powering Development and Testing Environments with Vagrant
Powering Development and Testing Environments with VagrantPowering Development and Testing Environments with Vagrant
Powering Development and Testing Environments with VagrantCoen Jacobs
 
Improved development workflows using vagrant
Improved development workflows using vagrantImproved development workflows using vagrant
Improved development workflows using vagrantMakis Asimidis
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerJohn Rofrano
 
Using Vagrant, Puppet, Testing & Hadoop
Using Vagrant, Puppet, Testing & HadoopUsing Vagrant, Puppet, Testing & Hadoop
Using Vagrant, Puppet, Testing & HadoopPuppet
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopPuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopWalter Heck
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopPuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopOlinData
 
Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Hendrik Ebbers
 
Varying WordPress Development Environment WordCamp Columbus 2016
Varying WordPress Development Environment WordCamp Columbus 2016Varying WordPress Development Environment WordCamp Columbus 2016
Varying WordPress Development Environment WordCamp Columbus 2016David Brattoli
 
Version Control and Continuous Integration
Version Control and Continuous IntegrationVersion Control and Continuous Integration
Version Control and Continuous IntegrationGeff Henderson Chang
 
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefOpscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefChef Software, Inc.
 
Vagrant for Effective DevOps Culture
Vagrant for Effective DevOps CultureVagrant for Effective DevOps Culture
Vagrant for Effective DevOps CultureVaidik Kapoor
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development EnvironmentsOscar Merida
 
Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016David Brattoli
 
Chef, Vagrant and Friends
Chef, Vagrant and FriendsChef, Vagrant and Friends
Chef, Vagrant and FriendsBen McRae
 
Containing the world with Docker
Containing the world with DockerContaining the world with Docker
Containing the world with DockerGiuseppe Piccolo
 
Vagrant in 15 minutes
Vagrant in 15 minutesVagrant in 15 minutes
Vagrant in 15 minutesAnton Weiss
 

Ähnlich wie Vagrant and Chef on FOSSASIA 2014 (20)

Powering Development and Testing Environments with Vagrant
Powering Development and Testing Environments with VagrantPowering Development and Testing Environments with Vagrant
Powering Development and Testing Environments with Vagrant
 
Improved development workflows using vagrant
Improved development workflows using vagrantImproved development workflows using vagrant
Improved development workflows using vagrant
 
Vagrant For DevOps
Vagrant For DevOpsVagrant For DevOps
Vagrant For DevOps
 
Instant ColdFusion with Vagrant
Instant ColdFusion with VagrantInstant ColdFusion with Vagrant
Instant ColdFusion with Vagrant
 
Making Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and DockerMaking Developers Productive with Vagrant, VirtualBox, and Docker
Making Developers Productive with Vagrant, VirtualBox, and Docker
 
Instant ColdFusion with Vagrant
Instant ColdFusion with VagrantInstant ColdFusion with Vagrant
Instant ColdFusion with Vagrant
 
Using Vagrant, Puppet, Testing & Hadoop
Using Vagrant, Puppet, Testing & HadoopUsing Vagrant, Puppet, Testing & Hadoop
Using Vagrant, Puppet, Testing & Hadoop
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopPuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
 
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & HadoopPuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
PuppetCamp SEA 1 - Using Vagrant, Puppet, Testing & Hadoop
 
Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013Vagrant Binding JayDay 2013
Vagrant Binding JayDay 2013
 
Vagrant & Docker
Vagrant & DockerVagrant & Docker
Vagrant & Docker
 
Varying WordPress Development Environment WordCamp Columbus 2016
Varying WordPress Development Environment WordCamp Columbus 2016Varying WordPress Development Environment WordCamp Columbus 2016
Varying WordPress Development Environment WordCamp Columbus 2016
 
Version Control and Continuous Integration
Version Control and Continuous IntegrationVersion Control and Continuous Integration
Version Control and Continuous Integration
 
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefOpscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with Chef
 
Vagrant for Effective DevOps Culture
Vagrant for Effective DevOps CultureVagrant for Effective DevOps Culture
Vagrant for Effective DevOps Culture
 
Building with Virtual Development Environments
Building with Virtual Development EnvironmentsBuilding with Virtual Development Environments
Building with Virtual Development Environments
 
Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016Varying wordpressdevelopmentenvironment wp-campus2016
Varying wordpressdevelopmentenvironment wp-campus2016
 
Chef, Vagrant and Friends
Chef, Vagrant and FriendsChef, Vagrant and Friends
Chef, Vagrant and Friends
 
Containing the world with Docker
Containing the world with DockerContaining the world with Docker
Containing the world with Docker
 
Vagrant in 15 minutes
Vagrant in 15 minutesVagrant in 15 minutes
Vagrant in 15 minutes
 

Kürzlich hochgeladen

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 

Kürzlich hochgeladen (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

Vagrant and Chef on FOSSASIA 2014

  • 1. Reproducible and Portable Work Environments with Vagrant and Chef
  • 2. About Me • 33 years old, almost married • From Karlsruhe, Germany • Studied Computer Science • Hobbies: guitar, climbing, cycling, travel, photography • Works in Phnom Penh for 3 months • Working with TYPO3
  • 3.
  • 4. Outline • Motivation • Introducing Vagrant & Chef • Vagrant „Hands-On“ • Advanced usage
  • 5.
  • 6. Motivation • Internal project • Estimated development time ~2 years • Approx. 15 developers • 2-day sprints, every second week • 4 developers per sprint
  • 7. Motivation Observations • Setting up dev environment takes > 1 day – More than ½ of the sprint time! • Developers spent too much time on setup • Always needed physical server for testing
  • 8. Solution: Vagrant Boxes Provisioning 2 virtual machines... • ...each with an extended LAMP stack*) • ...with 4 different projects takes less than 15 minutes *) including RabbitMQ, Solr, Git, Composer, tons of PHP modules...
  • 9. Technological Stack VirtualBox Free open source virtualization tool Chef Automation tool for Configuration Management Vagrant “Remote control” for VirtualBox
  • 10.
  • 11. What is Vagrant? • Building tool for portable work environments • Tool for distributing work environments • Written in Ruby • Open Source • Build upon well-established tools
  • 12. Vagrant Components • Vagrant Box • Vagrantfile • Provisioners • Providers
  • 13. Vagrant Boxes • Pre-installed base images • Used as base layer for all further provisioning • Many different boxes available online:
  • 14. The Vagrantfile • Marks root directory of Vagrant project • Describes what Vagrant box to use • Describes settings of box (e.g. network) • Triggers the provisioning of box (using Chef)
  • 15. Provisioners • Configures your Vagrant box by – Installing packages and software – Configuration and starting of services • Multiple provisioners available • Run once the box is booted
  • 16. Providers • Describe in which virtualization environment to provision your machines • Multiple providers available – VirtualBox – VMWare – Amazon AWS
  • 17.
  • 18. What is Chef? • Configuration Management automation tool • Written in Ruby • „Code your desired system state“ • Put system state into version control • Relies on a client / server architecture – Or use chef solo without a server
  • 21.
  • 22. Using chef-solo • mount cookbooks directory into your box config.vm.synced_folder "./chef", "/var/chef" config.vm.synced_folder "./home", "/var/ vagrant-home" • run chef-solo in your box config.vm.provision :shell do |s| s.inline = "sudo chef-solo -c /var/chef/ solo.rb -j /var/vagrant-home/config.json" end
  • 23. The solo.rb File • Define some paths: file_cache_path "/var/chef-cache" cookbook_path ["/var/chef/cookbooks”] data_bag_path "/var/chef/data_bags" role_path "/var/chef/roles"
  • 24. The config.json File • Define cookbook runlist: {"run_list" : ["recipe[cookbook_name]"]} • Further configuration in config.json overwrites defaults in cookbooks node['key1']['key2']
  • 25. Chef Provisioning Alternatives • Different ways for Chef provisioning – Mounting Cookbooks and use chef-solo – Copy Cookbooks into box and use chef-solo – Use Chef client in box and Chef server
  • 26. Overview 2 Chef Cookbooks /home/vagrant/chef mounted/copied into OR taken from chef server Vagrant Box 4 uses cookbooks triggers chef 3 remote controlls 1
  • 27.
  • 28. Provisioning Activity Provisioning Activity Provision Projects Configuration Management Booting Box Set up Box Chef, Git Vagrant, Chef Vagrant, VirtualBox Vagrant
  • 29. Set Up Box 1. Install VirtualBox & Vagrant 2. Add a box vagrant box add box_name http://box_url 1. Create a first Vagrantfile mkdir vagrant cd vagrant vagrant init
  • 30. Set up & Boot the Box 4. Use the box in your Vagrantfile Vagrant.configure("2") do |config| config.vm.box = "box_name" end 5. Boot your machine vagrant up 6. ssh into your machine vagrant ssh
  • 31. Versioning and Distribution • Remember: „Everything should be put into Version Control!“ • Vagrantfile can easily be put into any VCS • Distributing an environment is as easy as git clone git@github.com:my/vagrant.git cd vagrant vagrant up
  • 32. Daily Vagrant Usage • Start the box vagrant up • Stop the box Vagrant halt • Suspend the box vagrant suspend • Resume the box vagrant resume
  • 33.
  • 34. Multiple Boxes for Multiple Projects PROs - Easy to set up - Can have different systems in a box Vagrant Box Project 1 Vagrant Box Project 2 CONs - Have multiple Boxes running at the same time consumes resources Vagrant Box Project 3
  • 35. Multiple Projects in one Box PROs - Less ressources required Vagrant Box Project 1 Project 2 Project 3 CONs - No easy way to set up - Longer provisioning time - Bigger boxes
  • 36. Identical Copy of Server server is provisioned using Chef Client Chef Client Chef Server Chef Cookbooks mounted/copied into OR taken from chef server provisioned using same cookboks Identical Copy of Server as Vagrant Box
  • 37. Vagrant & Chef for CI / CD • Set up the whole deployment chain locally • Use tools like Jenkins inside your boxes • Provision the projects on Jenkins with Chef
  • 38. DevOps • Tools like Vagrant and Chef bring Developers and system operators closer together • Learn from each other • Use each other‘s tools for problem solving
  • 39.
  • 40.
  • 41. Summary • Vagrant is a great tool for portable boxes • Chef can help you manage your configuration • „Infrastructure as Code“ • Same environment on dev and live system • DevOps brings devs and admins together