Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hello Vagrant

Thiện
October 29, 2014

Hello Vagrant

Thiện

October 29, 2014
Tweet

More Decks by Thiện

Other Decks in Programming

Transcript

  1. What is Vagrant and why use it? About me Thien

    Tran Duy PHP Developer since 2012 User 2877596 on stackoverflow Loves open source Developments Go1 Company [email protected] October 29, 2014 GO1 (meetup) Vagrant October 29, 2014 1 / 9
  2. The First Section Summary 1 Information 2 Basic usage 3

    In Conclusions GO1 (meetup) Vagrant October 29, 2014 2 / 9
  3. The two Section Information What is Vagrant? Vagrant is a

    tool for building complete development environments, sandboxed in a virtual machine. Vagrant lowers development environment setup time, increases development/production parity, and brings the idea of disposable compute resources down to the desktop 1 Developer tool that automates VM management GO1 (meetup) Vagrant October 29, 2014 3 / 9
  4. The two Section Information What is Vagrant? Vagrant is a

    tool for building complete development environments, sandboxed in a virtual machine. Vagrant lowers development environment setup time, increases development/production parity, and brings the idea of disposable compute resources down to the desktop 1 Developer tool that automates VM management 2 Automate the setup of your development environment GO1 (meetup) Vagrant October 29, 2014 3 / 9
  5. The two Section Information What is Vagrant? Vagrant is a

    tool for building complete development environments, sandboxed in a virtual machine. Vagrant lowers development environment setup time, increases development/production parity, and brings the idea of disposable compute resources down to the desktop 1 Developer tool that automates VM management 2 Automate the setup of your development environment 3 Terminology Provision Mount Vagrantfile Ruby GO1 (meetup) Vagrant October 29, 2014 3 / 9
  6. the two section Information Why Vagrant & Benefits ? Vagrant

    provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the productivity and flexibility of you and your team. 1 If you are a developer GO1 (meetup) Vagrant October 29, 2014 4 / 9
  7. the two section Information Why Vagrant & Benefits ? Vagrant

    provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the productivity and flexibility of you and your team. 1 If you are a developer 2 If you are an operations engineer GO1 (meetup) Vagrant October 29, 2014 4 / 9
  8. the two section Information Why Vagrant & Benefits ? Vagrant

    provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the productivity and flexibility of you and your team. 1 If you are a developer 2 If you are an operations engineer 3 If you are a designer GO1 (meetup) Vagrant October 29, 2014 4 / 9
  9. the two section Information Why Vagrant & Benefits ? Vagrant

    provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the productivity and flexibility of you and your team. 1 If you are a developer 2 If you are an operations engineer 3 If you are a designer 4 The server disk died GO1 (meetup) Vagrant October 29, 2014 4 / 9
  10. the two section Information Why Vagrant & Benefits ? Vagrant

    provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the productivity and flexibility of you and your team. 1 If you are a developer 2 If you are an operations engineer 3 If you are a designer 4 The server disk died 5 It will mange VM for you , describe VM in configuration file GO1 (meetup) Vagrant October 29, 2014 4 / 9
  11. the two section Information Why Vagrant & Benefits ? Vagrant

    provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the productivity and flexibility of you and your team. 1 If you are a developer 2 If you are an operations engineer 3 If you are a designer 4 The server disk died 5 It will mange VM for you , describe VM in configuration file 6 You can allow other to contribute GO1 (meetup) Vagrant October 29, 2014 4 / 9
  12. The four Section Installing Vagrant 1 Get a VirtualBox 2

    Installing the Vagrant package for your operating system 3 Get a Vagrant Box GO1 (meetup) Vagrant October 29, 2014 5 / 9
  13. The four Section Your First Vagrant Machine 1 Up and

    Running vagrant init hashicorp/precise32 vagrant up GO1 (meetup) Vagrant October 29, 2014 6 / 9
  14. The four Section Your First Vagrant Machine 1 Up and

    Running vagrant init hashicorp/precise32 vagrant up 2 The Vagrantfile Vagrant.configure(versiob) do |config| config.vm.box = ”hashicorp/precise32” GO1 (meetup) Vagrant October 29, 2014 6 / 9
  15. The four Section Your First Vagrant Machine 1 Up and

    Running vagrant init hashicorp/precise32 vagrant up 2 The Vagrantfile Vagrant.configure(versiob) do |config| config.vm.box = ”hashicorp/precise32” 3 Working with the Vagrant Machine State of the Vagrant machine SSH Share filesystem Basic networking GO1 (meetup) Vagrant October 29, 2014 6 / 9
  16. The four Section Provisioning Your Vagrant VM 1 Why Automated

    Provisioning? 2 Supported Provisioners Shell script Chef or Puppet 3 Automated Provisioner Basics GO1 (meetup) Vagrant October 29, 2014 7 / 9
  17. The four Section Create the following provision.sh in your project

    directory: #! / usr / bin /env bash echo ” I n s t a l l i n g Apache and s e t t i n g i t up . . . ” apt−get update apt−get i n s t a l l −y apache2 >/dev/ n u l l 2>&1 rm −r f / var /www l n −f s / vagrant / var /www With the shell script created, the next step is to configure Vagrant to use the script. Add the following line somewhere in the Vagrantfile: c o n f i g .vm. p r o v i s i o n ” s h e l l ” , path : ” p r o v i s i o n . sh ” GO1 (meetup) Vagrant October 29, 2014 8 / 9
  18. The four Section In conclusion In this topic, we showed

    that a bare-bones Vagrant environment can be brought up in just two commands with no additional configuration. Also we introduced all the available automated provisioners in Vagrant, showing how theyre used to set up a basic Apache web sever as an example. GO1 (meetup) Vagrant October 29, 2014 8 / 9