Vagrant Plugin
Development
Intro
@budhrg
@budhrg
budhram#IRC
Work @
Budh Ram Gurung
Blog @ http://budhram.info
What is Vagrant?
● VM Management Tool
● Automate development environment setup
● Close friend of Developer
About Vagrant Plugin
● Plugin Centric
● Most basic features are implemented via built-in plugins
● Internal and external plugins uses the same API
Available Vagrant Plugins
• vagrant-aws • vagrant-omnibus • vagrant-foodshow
• vagrant-digitalocean • vagrant-fabric • vagrant-hostsupdater
• vagrant-google • vagrant-berkshelf • vagrant-reload
• vagrant-libvirt • vagrant-librarian-chef • vagrant-vbguest
• vagrant-lxc • vagrant-librarian-puppet • oh-my-vagrant
• vagrant-openstack • vagrant-puppet-install • sahara
• vagrant-parallels • vagrant-cachier • landrush
• vagrant-rackspace • vagrant-serverspec • <...>
Let’s build
a
Simple Plugin
https://www.noppanit.com/create-simple-vagrant-pluginCredits -
Create directories/files
../vagrant-ls $ mkdir lib lib/vagrant-ls
../vagrant-ls $ touch Gemfile vagrant-ls.gemspec Rakefile lib/vagrant-ls.rb
lib/vagrant-ls/version.rb
lib/vagrant-ls/plugin.rb
lib/vagrant-ls/command.rb
../demo $ mkdir vagrant-ls && cd vagrant-ls
Gemfile
source 'https://rubygems.org'
group :development do
gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git'
gem 'json'
gem 'rake'
gem 'bundler', '~> 1.6'
end
group :plugins do
gem 'vagrant-ls', path: '.'
end
vagrant-ls.gemspec
require File.expand_path('../lib/vagrant-ls/version', __FILE__)
Gem::Specification.new do |s|
s.name = 'vagrant-ls'
s.version = VagrantPlugins::Ls::VERSION
s.summary = "List all vms"
s.description = "A simple vagrant plugin for listing all vms"
s.authors = ["Budh Ram Gurung"]
s.email = 'budhram.gurung01@gmail.com'
...
... other common configurations ...
...
end
Rakefile
require 'bundler/gem_tasks'
lib/vagrant-ls.rb
begin
require 'vagrant'
rescue LoadError
raise 'The Vagrant vagrant-ls plugin must be run within Vagrant.'
end
require 'vagrant-ls/plugin'
lib/vagrant-ls/version.rb
module VagrantPlugins
module Ls
VERSION = '0.0.1'
end
end
lib/vagrant-ls/plugin.rb
module VagrantPlugins
module Ls
class Plugin < Vagrant.plugin('2')
name "List"
description “This plugin 'ls' all of the vms running inside the machine”
command 'ls' do
require_relative 'command'
Command
end
end
end
end
lib/vagrant-ls/command.rb (actual implementation)
module VagrantPlugins
module Ls
class Command < Vagrant.plugin('2', :command)
def execute
# Your plugin logic
exec('VBoxManage list vms')
0
end
end
end
end
../vagrant-ls $ bundle exec vagrant list-commands
Below is a listing of all available Vagrant commands and a brief
description of what they do.
box manages boxes: installation, removal, etc.
halt stops the vagrant machine
help shows the help for a subcommand
..........................................................................................
ls list all of the vms running inside the machine
..........................................................................................
suspend suspends the machine
up starts and provisions the vagrant environment
version prints current and latest Vagrant version
Check your command
../vagrant-ls $ bundle exec vagrant ls
"win7-ie10_default_1456812636294_67555" {4edcfa84-627c-446d-8ba4-311c6c2b134b}
"vagrant-devtools_default_1458233788740_76759" {7ef9b907-1bd1-4d39-92e5-2a3c572128d0}
"test_adb_default_1458279527566_54262" {19d3a56b-2f73-428f-b34b-edffe8ec2ca5}
"vagrant-ls_default_1458362268506_16566" {12d4eec5-20bc-4129-b993-a4170b6937e3}
"vagrant-service-manager_default_1458367027826_45167" {820afb23-3651-424e-9236-
1d54cd9b4a49}
Run your command
Build your plugin
../vagrant-ls $ rake build
vagrant-ls 0.0.1 built to pkg/vagrant-ls-0.0.1.gem.
● vagrant-service-manager
○ Provides services setup information
○ Environment variables
○ TLS certificates
○ Services like Docker, Openshift etc
We are working on a plugin
● Hosted @
https://github.com/projectatomic/vagrant-service-manager
Graphical Overview
../demo $ vagrant init projectatomic/adb
../demo $ vagrant plugin install vagrant-service-manager
../demo $ vagrant up
How to start?
../demo eval "$(bundle exec vagrant service-manager env docker)"
How to use plugin?
# Pre-requisite : Docker Client
# Check Docker
./demo $ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
Thanks

More Related Content

ODP
Nodejs Intro - Part2 Introduction to Web Applications
PPT
Nodejs Intro Part One
PDF
Running JavaScript Efficiently in a Java World
PPT
Node.js Cloud deployment
PDF
Node4J: Running Node.js in a JavaWorld
PDF
Module, AMD, RequireJS
PPTX
Deploy Node.js application in Heroku using Eclipse
PDF
Nodejs Intro - Part2 Introduction to Web Applications
Nodejs Intro Part One
Running JavaScript Efficiently in a Java World
Node.js Cloud deployment
Node4J: Running Node.js in a JavaWorld
Module, AMD, RequireJS
Deploy Node.js application in Heroku using Eclipse

What's hot (20)

PDF
Create your very own Development Environment with Vagrant and Packer
PDF
Multi-provider Vagrant and Chef: AWS, VMware, and more
PDF
Angular2 ecosystem
PDF
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
PDF
Getting Started with Ansible
PPTX
Node.js debugging
PDF
Multiple django applications on a single server with nginx
PDF
Superfast Automated Web Testing with CasperJS & PhantomJS
PDF
Preparation study of_docker - (MOSG)
PPTX
Controlling multiple VMs with the power of Python
PDF
Jenkins and Groovy
PDF
Instruction: dev environment
PDF
System webpack-jspm
PDF
Site Testing with CasperJS
KEY
OSCON 2011 - Node.js Tutorial
PDF
CasperJS and PhantomJS for Automated Testing
PDF
GlassFish Embedded API
PDF
Introduction to Vagrant
PPTX
Node.js in a heterogeneous system
PDF
Java/Spring과 Node.js의 공존 시즌2
Create your very own Development Environment with Vagrant and Packer
Multi-provider Vagrant and Chef: AWS, VMware, and more
Angular2 ecosystem
Devoxx UK 2013: Sandboxing with the Vagrant-Binding API
Getting Started with Ansible
Node.js debugging
Multiple django applications on a single server with nginx
Superfast Automated Web Testing with CasperJS & PhantomJS
Preparation study of_docker - (MOSG)
Controlling multiple VMs with the power of Python
Jenkins and Groovy
Instruction: dev environment
System webpack-jspm
Site Testing with CasperJS
OSCON 2011 - Node.js Tutorial
CasperJS and PhantomJS for Automated Testing
GlassFish Embedded API
Introduction to Vagrant
Node.js in a heterogeneous system
Java/Spring과 Node.js의 공존 시즌2
Ad

Viewers also liked (20)

PDF
The Innovative CIO's Discussion of Enterprise Mobility
PPTX
Ancillaries: Final!
PPTX
Как считают Интернет
PPTX
Hanh vi tim kiem cua nguoi dung & chien luoc cua doanh nghiep
DOC
Uunisepät
PPT
Vikram singh
PPTX
Articles
PDF
дистанционный резидент
PPTX
Customer service february 2012
PDF
из книги егэ. математика. самостоятельная подг. к егэ лаппо, попов 2011
PPTX
Presentation 1 edu 290
PDF
Northern lights college
PDF
Артем Смыслов. Портрет пользователя
PPTX
Creative destruction
PPT
49566238 melaksanakan-aktiviti-prabacaan
PDF
Infectious // August // 2011
DOCX
Trabajo del examen
PDF
Brick Factory Logos Round 1
PDF
13.03.27 communityvoices
PPTX
Capitulo ii 2011
The Innovative CIO's Discussion of Enterprise Mobility
Ancillaries: Final!
Как считают Интернет
Hanh vi tim kiem cua nguoi dung & chien luoc cua doanh nghiep
Uunisepät
Vikram singh
Articles
дистанционный резидент
Customer service february 2012
из книги егэ. математика. самостоятельная подг. к егэ лаппо, попов 2011
Presentation 1 edu 290
Northern lights college
Артем Смыслов. Портрет пользователя
Creative destruction
49566238 melaksanakan-aktiviti-prabacaan
Infectious // August // 2011
Trabajo del examen
Brick Factory Logos Round 1
13.03.27 communityvoices
Capitulo ii 2011
Ad

Similar to Vagrant plugin development intro (20)

PPTX
DevOps Hackathon - Session 1: Vagrant
PPTX
Vagrant
PDF
Vagrant workshop 2015
PPTX
Vagrant
PDF
Intro to vagrant
PDF
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
PPTX
Harmonious Development: Via Vagrant and Puppet
PDF
Vagrant-Binding JUG Dortmund
PPTX
Vagrant-Overview
PDF
Getting started with Vagrant
KEY
ODP
It Works On My Machine: Vagrant for Software Development
PDF
Vagrant for Virtualized Development
PDF
Vagrant - Team Development made easy
PPTX
20180607 master your vms with vagrant
PDF
Vagrant
PDF
Lightweight and reproducible environments with vagrant and Puppet
PPT
Vagrant
PDF
Vagrant For DevOps
PDF
Local development environment through virtualisation
DevOps Hackathon - Session 1: Vagrant
Vagrant
Vagrant workshop 2015
Vagrant
Intro to vagrant
DevOps Series: Defining and Sharing Testable Machine Configurations with vagrant
Harmonious Development: Via Vagrant and Puppet
Vagrant-Binding JUG Dortmund
Vagrant-Overview
Getting started with Vagrant
It Works On My Machine: Vagrant for Software Development
Vagrant for Virtualized Development
Vagrant - Team Development made easy
20180607 master your vms with vagrant
Vagrant
Lightweight and reproducible environments with vagrant and Puppet
Vagrant
Vagrant For DevOps
Local development environment through virtualisation

Recently uploaded (20)

PDF
ELLIE29.pdfWETWETAWTAWETAETAETERTRTERTER
PDF
ment.tech-How to Develop an AI Agent Healthcare App like Sully AI (1).pdf
PDF
Applying Agentic AI in Enterprise Automation
PPTX
From XAI to XEE through Influence and Provenance.Controlling model fairness o...
PPTX
Blending method and technology for hydrogen.pptx
PDF
Altius execution marketplace concept.pdf
PDF
Secure Java Applications against Quantum Threats
PPT
Overviiew on Intellectual property right
PPTX
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
PDF
TicketRoot: Event Tech Solutions Deck 2025
PDF
The Digital Engine Room: Unlocking APAC’s Economic and Digital Potential thro...
PDF
State of AI in Business 2025 - MIT NANDA
PDF
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf
PDF
Rooftops detection with YOLOv8 from aerial imagery and a brief review on roof...
PDF
Peak of Data & AI Encore: Scalable Design & Infrastructure
PDF
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
PDF
NewMind AI Journal Monthly Chronicles - August 2025
PPTX
CRM(Customer Relationship Managmnet) Presentation
PPTX
maintenance powerrpoint for adaprive and preventive
PPTX
Slides World Game (s) Great Redesign Eco Economic Epochs.pptx
ELLIE29.pdfWETWETAWTAWETAETAETERTRTERTER
ment.tech-How to Develop an AI Agent Healthcare App like Sully AI (1).pdf
Applying Agentic AI in Enterprise Automation
From XAI to XEE through Influence and Provenance.Controlling model fairness o...
Blending method and technology for hydrogen.pptx
Altius execution marketplace concept.pdf
Secure Java Applications against Quantum Threats
Overviiew on Intellectual property right
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
TicketRoot: Event Tech Solutions Deck 2025
The Digital Engine Room: Unlocking APAC’s Economic and Digital Potential thro...
State of AI in Business 2025 - MIT NANDA
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf
Rooftops detection with YOLOv8 from aerial imagery and a brief review on roof...
Peak of Data & AI Encore: Scalable Design & Infrastructure
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
NewMind AI Journal Monthly Chronicles - August 2025
CRM(Customer Relationship Managmnet) Presentation
maintenance powerrpoint for adaprive and preventive
Slides World Game (s) Great Redesign Eco Economic Epochs.pptx

Vagrant plugin development intro