0%

Book Description

Use Vagrant to easily build complete development environments

Key Features

  • Implement DevOps with Vagrant effectively
  • Integrate Vagrant with different tools such as Puppet, Chef, and Docker
  • Manage infrastructure with a practical approach

Book Description

Hands-On DevOps with Vagrant teaches you how to use Vagrant as a powerful DevOps tool and gives an overview of how it fits into the DevOps landscape. You will learn how to install VirtualBox and Vagrant in Windows, macOS, and Linux. You will then move on to understanding Vagrant commands, discovering its boxes and Vagrant Cloud.

After getting to grips with the basics, the next set of chapters helps you to understand how to configure Vagrant, along with networking. You will explore multimachine, followed by studying how to create multiple environments and the communication between them. In addition to this, you will cover concepts such as Vagrant plugins and file syncing.

The last set of chapters provides insights into provisioning shell scripts, also guiding you in how to use Vagrant with configuration management tools such as Chef, Ansible, Docker, Puppet, and Salt.

By the end of this book, you will have grasped Vagrant's features and how to use them for your benefit with the help of tips and tricks.

What you will learn

  • Explore what development features Vagrant offers
  • Install Vagrant and VirtualBox on Windows, macOS and Linux
  • Harness the power of Vagrant to create powerful development environments
  • Utilize DevOps tools such as Docker, Chef, and Puppet
  • Understand everything about Vagrant, including networking, plugins, and provisioning
  • Use the Vagrant Cloud to install and manage Vagrant boxes

Who this book is for

Hands-On DevOps with Vagrant is for you if you are a system administrator, DevOps engineer, DevOps architect, or any stakeholder working with DevOps and wanting to explore Vagrant. Experience in system administration is needed to enjoy this book.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Hands-On DevOps with Vagrant
  3. Dedication
  4. Packt Upsell
    1. Why subscribe?
    2. Packt.com
  5. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  7. Introduction
    1. Getting started with Vagrant and DevOps
      1. Understanding Vagrant
        1. Vagrant features
          1. Vagrantfile
          2. Boxes
          3. Networking
          4. Provisioning
          5. Plugins
      2. Advantages of Vagrant
        1. Development team
        2. Operations team
        3. Design team
      3. What is VirtualBox?
      4. What is DevOps?
    2. Vagrant for DevOps
      1. Current state of development within DevOps
      2. Vagrant and DevOps
      3. Using Vagrant as a day-to-day DevOps tool
    3. Summary
  8. Installing VirtualBox and Vagrant
    1. Installing VirtualBox and Vagrant on Windows
      1. Prerequisites
        1. System version
        2. CPU architecture
      2. Installing VirtualBox on Windows 10
      3. Installing Vagrant on Windows 10
    2. Installing VirtualBox and Vagrant on Linux
      1. Prerequisites
        1. System version
        2. CPU architecture
      2. Installing VirtualBox on Ubuntu 16.04
      3. Installing Vagrant on Ubuntu 16.04
    3. Installing VirtualBox and Vagrant on macOS
      1. Prerequisites
        1. System version
        2. CPU architecture
      2. Installing VirtualBox on Mac OS 10.11.3
      3. Installing Vagrant on macOS 10.13.3
    4. Summary
  9. Command Line-Interface - Vagrant Commands
    1. Vagrant command overview
    2. Vagrant commands in depth
      1. A brief note on formatting commands
      2. General Vagrant commands and sub-commands
        1. The list-commands command
          1. Options/flags
        2. The help command
        3. The version command
          1. Options/flags
        4. The global-status command
          1. Options/flags
      3. Vagrant's configuration commands and sub-commands
        1. The login command
          1. Options/flags
        2. The package command
          1. Options/flags
        3. The snapshot command
          1. sub-commands
        4. The provider command
          1. Options/flags
        5. The plugin command
          1. sub-commands
        6. The cap command
          1. Options/flags
      4. Day-to-day Vagrant commands and sub-commands
        1. The box command
          1. sub-commands
        2. The destroy command
          1. Options/flags
        3. The halt command
          1. Options/flags
        4. The init command
          1. Options/flags
        5. The port command
          1. Options/flags
        6. The provision command
          1. Options/flags
        7. The push command
          1. Options/flags
        8. The reload command
          1. Options/flags
        9. The resume command
          1. Options/flags
        10. The status command
          1. Options/flags
        11. The suspend command
          1. Options/flags
        12. The up command
          1. Options/flags
        13. The validate command
          1. Options/flags
      5. Application-specific Vagrant commands and sub-commands
        1. The docker-exec command
          1. Options / flags
        2. The docker-logs command
          1. Options/flags
        3. The docker-run command
          1. Options/flags
        4. The rdp command
          1. Options/flags
        5. The rsync command
          1. Options/flags
        6. The rsync-auto command
          1. Options/flags
        7. The ssh command
          1. Options/flags
        8. The ssh-config command
          1. Options/flags
        9. The powershell command
          1. Options /flags
      6. A typical Vagrant workflow using commands
    3. Troubleshooting
    4. Summary
  10. Discovering Vagrant Boxes - Vagrant Cloud
    1. Understanding Vagrant boxes
      1. Vagrant box file anatomy
        1. Box file
        2. Box metadata
        3. Box information
      2. How to install a Vagrant box
        1. Direct URL to box file
        2. Shorthand/alias to box file
        3. A file path or URL to a box in a specific catalog
      3. How to delete a Vagrant box
        1. Deleting a specific version of a box
        2. Deleting all versions of a box
      4. Box versioning
    2. Vagrant Cloud
      1. Understanding the Vagrant Cloud
        1. Vagrant Cloud website
        2. Installing a Vagrant box found on the Vagrant Cloud – Part 1, Search
        3. Installing a Vagrant box found on the Vagrant Cloud – Part 2, Install
    3. Uploading a Vagrant box to the Vagrant cloud
      1. Creating a Vagrant box
    4. Enterprise solutions for Vagrant boxes
    5. Summary
  11. Configuring Vagrant Using a Vagrantfile
    1. Understanding Vagrantfiles
      1. Creating a Vagrantfile
      2. Vagrantfile syntax
    2. Vagrantfile options
      1. Vagrant machine configuration (config.vm)
      2. Vagrant SSH configuration (config.ssh)
      3. Vagrant settings (config.vagrant)
      4. Other Vagrantfile settings
        1. WinRM settings (config.winrm)
        2. WinSSH settings (config.ssh and config.winssh)
    3. Troubleshooting a Vagrantfile
    4. Summary
  12. Networking in Vagrant
    1. Port-forwarding
      1. Port-forwarding notes
    2. Private networking
      1. DHCP
      2. Static IP
        1. IPv6
    3. Public networking
      1. DHCP
      2. Static IP
      3. Network bridge
    4. Summary
  13. Multi-Machine
    1. An introduction to Vagrant multi-machine
      1. Load balancing with Vagrant multi-machine
        1. lb.sh
        2. web.sh
        3. Vagrant multi-machine shell provisioning
        4. multi-machine SSH
      2. Web server and database setup with Vagrant multi-machine
        1. web.sh
        2. db.sh
        3. Nginx and PHP configuration
        4. MySQL configuration
    2. Summary
  14. Exploring Vagrant Plugins and Syncing Files
    1. Understanding Vagrant plugins
      1. The anatomy of a Vagrant plugin
        1. Gem
        2. bundler
      2. Managing Vagrant plugins
        1. Vagrant plugin installation methods
          1. Installing a Vagrant plugin from a local file
          2. Installing a Vagrant plugin from a known gem source
      3. Vagrant plugin commands and subcommands
      4. Finding, installing, and using a Vagrant plugin
        1. Installing a Vagrant plugin
        2. Uninstalling a Vagrant plugin
    2. Vagrant file-syncing
      1. Setting up synced folders
        1. Synced folders with basic usage
        2. Synced folders with RSync
        3. Synced folders with NFS
    3. Summary
  15. Shell Scripts - Provisioning
    1. Introduction to Vagrant provisioning
    2. Understanding configuration management
    3. Basic usage of Vagrant provisioning
      1. Vagrant provisioning commands
    4. Vagrant provisioning with a file
      1. Single file
      2. Directory
    5. Vagrant Shell provisioner
      1. Inline Scripts
      2. External scripts
      3. Script arguments
        1. Script argument – string
        2. Script argument – array
    6. Summary
  16. Ansible - Using Ansible to Provision a Vagrant Box
    1. Understanding Ansible
    2. Installing Ansible
      1. Installing Ansible on macOS High Sierra (version 10.13)
    3. Provisioning Vagrant using Ansible
      1. Provisioning Vagrant using Ansible on the host machine
      2. Provisioning Vagrant using Ansible on the guest machine
      3. Additional Ansible options
        1. Provisioner – Ansible
        2. Provisioner – Ansible local
    4. Ansible Playbooks
    5. Summary
  17. Chef - Using Chef to Provision a Vagrant Box
    1. Understanding Chef
    2. Chef Cookbook
      1. Recipes
      2. Templates
      3. Attribute values
      4. Extensions
      5. File distributors
    3. Chef Supermarket
      1. Search
    4. Provisioning Vagrant with Chef
      1. Installing Chef on macOS
      2. Using Chef Solo to provision a Vagrant machine
      3. Using Chef Client to provision a Vagrant machine
    5. Summary
  18. Docker - Using Docker with Vagrant
    1. Understanding Docker
      1. Key components of Docker
        1. Containers
        2. Images
        3. Registry
        4. Service
    2. Using the Docker Hub to find Docker images
    3. Basic usage – running a container
      1. pull
      2. run
      3. stop
      4. start
      5. search
    4. Using Docker to provision a Vagrant machine
    5. Docker-specific configuration in Vagrant
      1. Images
      2. build_image
        1. args
      3. pull_images
      4. run
        1. image
        2. cmd
        3. args
        4. auto_assign_name
        5. deamonize
        6. restart
      5. post_install_provisioner
    6. Summary
  19. Puppet - Using Puppet to Provision a Vagrant Box
    1. Understanding Puppet
      1. Resources
      2. Manifest
      3. Compile
      4. Catalogs
      5. Apply
      6. Desired state
    2. Puppet apply and Puppet agent
      1. Puppet apply
        1. Options
      2. Puppet agent
        1. Options
    3. Puppet Manifest example and syntax
      1. Syntax
    4. Provisioning with Puppet
      1. Provisioning with Puppet apply
      2. Provisioning with Puppet agent
    5. Summary
  20. Salt - Using Salt to Provision a Vagrant Box
    1. Understanding Salt
      1. Salt Master
      2. Salt Minion
      3. Modules
        1. Execution
        2. State
        3. Grains
        4. Renderer
        5. Returners
        6. Runners
    2. Salt states
      1. Syntax and example
    3. Provisioning Vagrant with Salt
    4. Salt options available within Vagrant
      1. Install options
      2. Minion options
      3. Master options
      4. Execute states
      5. Execute runners
      6. Output control
    5. Vagrant cheat sheet
      1. Testing a Vagrantfile
      2. Saving a snapshot
      3. Status
      4. Boxes
      5. Hardware specification
      6. Code deployment
      7. Multi-machine
      8. General
    6. Summary
  21. Other Book You May Enjoy
    1. Leave a review - let other readers know what you think
3.144.124.232