├── .yardopts
├── version.txt
├── test
├── vagrant-spec
│ ├── boxes
│ │ └── .keep
│ ├── scripts
│ │ ├── centos-run.virtualbox.sh
│ │ ├── ubuntu-run.virtualbox.sh
│ │ ├── ubuntu-setup.virtualbox.sh
│ │ └── centos-setup.virtualbox.sh
│ └── configs
│ │ └── vagrant-spec.config.virtualbox.rb
├── acceptance
│ ├── base.rb
│ ├── shared
│ │ └── context_virtualbox.rb
│ ├── skeletons
│ │ ├── linked_clone
│ │ │ └── Vagrantfile
│ │ └── network_intnet
│ │ │ └── Vagrantfile
│ └── provider-virtualbox
│ │ └── network_intnet_spec.rb
├── unit
│ ├── vagrant
│ │ ├── plugin
│ │ │ ├── v1
│ │ │ │ ├── host_test.rb
│ │ │ │ ├── communicator_test.rb
│ │ │ │ └── provider_test.rb
│ │ │ └── v2
│ │ │ │ ├── communicator_test.rb
│ │ │ │ ├── host_test.rb
│ │ │ │ └── components_test.rb
│ │ ├── util
│ │ │ ├── shell_quote_test.rb
│ │ │ ├── line_endings_helper_test.rb
│ │ │ └── ansi_escape_code_remover_test.rb
│ │ ├── host_test.rb
│ │ ├── action
│ │ │ └── builtin
│ │ │ │ └── env_set_test.rb
│ │ └── config
│ │ │ └── v2
│ │ │ └── util_test.rb
│ ├── plugins
│ │ ├── providers
│ │ │ └── virtualbox
│ │ │ │ ├── base.rb
│ │ │ │ └── driver
│ │ │ │ ├── version_4_0_test.rb
│ │ │ │ ├── version_4_1_test.rb
│ │ │ │ ├── version_4_2_test.rb
│ │ │ │ └── version_4_3_test.rb
│ │ ├── pushes
│ │ │ └── noop
│ │ │ │ └── config_test.rb
│ │ ├── kernel_v2
│ │ │ └── config
│ │ │ │ ├── package_test.rb
│ │ │ │ ├── vagrant_test.rb
│ │ │ │ └── ssh_test.rb
│ │ ├── communicators
│ │ │ └── winrm
│ │ │ │ └── config_test.rb
│ │ ├── guests
│ │ │ ├── amazon
│ │ │ │ └── cap
│ │ │ │ │ └── flavor_test.rb
│ │ │ ├── pld
│ │ │ │ └── cap
│ │ │ │ │ ├── flavor_test.rb
│ │ │ │ │ └── network_scripts_dir_test.rb
│ │ │ ├── linux
│ │ │ │ └── cap
│ │ │ │ │ └── mount_shared_folder_test.rb
│ │ │ ├── suse
│ │ │ │ └── cap
│ │ │ │ │ └── network_scripts_dir_test.rb
│ │ │ ├── alt
│ │ │ │ └── cap
│ │ │ │ │ └── network_scripts_dir_test.rb
│ │ │ └── redhat
│ │ │ │ └── cap
│ │ │ │ └── network_scripts_dir_test.rb
│ │ └── synced_folders
│ │ │ └── nfs
│ │ │ └── config_test.rb
│ ├── support
│ │ └── shared
│ │ │ ├── plugin_command_context.rb
│ │ │ └── action_synced_folders_context.rb
│ └── templates
│ │ └── guests
│ │ ├── netbsd
│ │ └── network_dhcp_test.rb
│ │ ├── freebsd
│ │ └── network_dhcp_test.rb
│ │ ├── arch
│ │ └── network_dhcp_test.rb
│ │ ├── funtoo
│ │ └── network_dhcp_test.rb
│ │ └── gentoo
│ │ └── network_dhcp_test.rb
└── config
│ └── acceptance_boxes.yml
├── templates
├── guests
│ ├── openbsd
│ │ ├── network_dhcp.erb
│ │ └── network_static.erb
│ ├── netbsd
│ │ ├── network_dhcp.erb
│ │ └── network_static.erb
│ ├── alt
│ │ ├── network_ipv4address.erb
│ │ ├── network_ipv4route.erb
│ │ ├── network_dhcp.erb
│ │ └── network_static.erb
│ ├── freebsd
│ │ ├── network_dhcp.erb
│ │ ├── network_static.erb
│ │ └── network_static6.erb
│ ├── nixos
│ │ ├── hostname.erb
│ │ └── network.erb
│ ├── arch
│ │ ├── network_dhcp.erb
│ │ ├── network_static.erb
│ │ └── network_static6.erb
│ ├── funtoo
│ │ ├── network_dhcp.erb
│ │ ├── network_static6.erb
│ │ └── network_static.erb
│ ├── gentoo
│ │ ├── network_dhcp.erb
│ │ ├── network_static6.erb
│ │ ├── network_static.erb
│ │ └── network_systemd.erb
│ ├── suse
│ │ ├── network_dhcp.erb
│ │ └── network_static.erb
│ ├── redhat
│ │ ├── network_dhcp.erb
│ │ ├── network_static6.erb
│ │ └── network_static.erb
│ ├── slackware
│ │ ├── network_dhcp.erb
│ │ └── network_static.erb
│ ├── coreos
│ │ └── etcd.service.erb
│ └── debian
│ │ ├── network_static.erb
│ │ ├── network_static6.erb
│ │ └── network_dhcp.erb
├── config
│ ├── validation_failed.erb
│ └── messages.erb
├── nfs
│ ├── exports.erb
│ ├── exports_freebsd.erb
│ └── exports_linux.erb
├── commands
│ └── init
│ │ └── Vagrantfile.min.erb
├── rgloader.rb
└── package_Vagrantfile.erb
├── contrib
├── st
│ └── Ruby.sublime-settings
├── vim
│ └── vagrantfile.vim
├── sudoers
│ ├── osx
│ ├── linux-suse
│ ├── linux-ubuntu
│ └── linux-fedora
└── emacs
│ └── vagrant.el
├── plugins
├── synced_folders
│ └── smb
│ │ └── scripts
│ │ └── ps_version.ps1
├── providers
│ ├── docker
│ │ ├── hostmachine
│ │ │ └── Vagrantfile
│ │ ├── cap
│ │ │ └── proxy_machine.rb
│ │ └── action
│ │ │ ├── is_build.rb
│ │ │ ├── has_ssh.rb
│ │ │ ├── host_machine_required.rb
│ │ │ ├── prepare_nfs_valid_ids.rb
│ │ │ ├── start.rb
│ │ │ ├── init_state.rb
│ │ │ └── stop.rb
│ ├── hyperv
│ │ ├── scripts
│ │ │ ├── delete_vm.ps1
│ │ │ ├── resume_vm.ps1
│ │ │ ├── suspend_vm.ps1
│ │ │ ├── delete_snapshot.ps1
│ │ │ ├── create_snapshot.ps1
│ │ │ ├── restore_snapshot.ps1
│ │ │ ├── stop_vm.ps1
│ │ │ ├── clone_vhd.ps1
│ │ │ ├── list_snapshots.ps1
│ │ │ ├── check_hyperv.ps1
│ │ │ ├── has_vmcx_support.ps1
│ │ │ ├── export_vm.ps1
│ │ │ ├── get_switches.ps1
│ │ │ ├── set_network_vlan.ps1
│ │ │ └── set_network_mac.ps1
│ │ ├── cap
│ │ │ ├── snapshot_list.rb
│ │ │ └── public_address.rb
│ │ └── action
│ │ │ ├── is_windows.rb
│ │ │ ├── delete_vm.rb
│ │ │ ├── stop_instance.rb
│ │ │ ├── start_instance.rb
│ │ │ ├── resume_vm.rb
│ │ │ ├── suspend_vm.rb
│ │ │ ├── message_will_not_destroy.rb
│ │ │ ├── package.rb
│ │ │ ├── package_setup_files.rb
│ │ │ ├── net_set_mac.rb
│ │ │ ├── snapshot_restore.rb
│ │ │ ├── package_setup_folders.rb
│ │ │ ├── net_set_vlan.rb
│ │ │ └── check_enabled.rb
│ └── virtualbox
│ │ ├── cap
│ │ └── public_address.rb
│ │ ├── action
│ │ ├── message_not_created.rb
│ │ ├── message_not_running.rb
│ │ ├── message_already_running.rb
│ │ ├── destroy.rb
│ │ ├── message_will_not_destroy.rb
│ │ ├── prepare_nfs_valid_ids.rb
│ │ ├── package.rb
│ │ ├── setup_package_files.rb
│ │ ├── suspend.rb
│ │ ├── package_setup_files.rb
│ │ ├── discard_state.rb
│ │ ├── package_setup_folders.rb
│ │ ├── clear_forwarded_ports.rb
│ │ ├── is_paused.rb
│ │ ├── is_saved.rb
│ │ ├── created.rb
│ │ ├── is_running.rb
│ │ ├── check_created.rb
│ │ ├── check_running.rb
│ │ └── boot.rb
│ │ └── driver
│ │ ├── version_5_1.rb
│ │ └── version_5_2.rb
├── pushes
│ ├── noop
│ │ ├── push.rb
│ │ ├── config.rb
│ │ └── plugin.rb
│ ├── atlas
│ │ └── errors.rb
│ ├── local-exec
│ │ └── errors.rb
│ ├── ftp
│ │ └── locales
│ │ │ └── en.yml
│ └── heroku
│ │ └── errors.rb
├── guests
│ ├── pld
│ │ ├── cap
│ │ │ ├── flavor.rb
│ │ │ └── network_scripts_dir.rb
│ │ └── guest.rb
│ ├── alt
│ │ ├── guest.rb
│ │ └── cap
│ │ │ ├── network_scripts_dir.rb
│ │ │ └── rsync.rb
│ ├── bsd
│ │ ├── guest.rb
│ │ └── cap
│ │ │ ├── halt.rb
│ │ │ └── virtualbox.rb
│ ├── redhat
│ │ ├── guest.rb
│ │ └── cap
│ │ │ ├── network_scripts_dir.rb
│ │ │ ├── rsync.rb
│ │ │ └── flavor.rb
│ ├── funtoo
│ │ ├── guest.rb
│ │ └── plugin.rb
│ ├── gentoo
│ │ └── guest.rb
│ ├── omnios
│ │ ├── guest.rb
│ │ └── cap
│ │ │ ├── rsync.rb
│ │ │ └── mount_nfs_folder.rb
│ ├── slackware
│ │ └── guest.rb
│ ├── amazon
│ │ ├── guest.rb
│ │ ├── cap
│ │ │ └── flavor.rb
│ │ └── plugin.rb
│ ├── arch
│ │ ├── guest.rb
│ │ └── cap
│ │ │ ├── rsync.rb
│ │ │ └── smb.rb
│ ├── dragonflybsd
│ │ ├── guest.rb
│ │ └── plugin.rb
│ ├── esxi
│ │ ├── guest.rb
│ │ └── cap
│ │ │ ├── change_host_name.rb
│ │ │ └── halt.rb
│ ├── haiku
│ │ ├── guest.rb
│ │ └── plugin.rb
│ ├── kali
│ │ ├── guest.rb
│ │ └── plugin.rb
│ ├── netbsd
│ │ ├── guest.rb
│ │ └── cap
│ │ │ ├── change_host_name.rb
│ │ │ └── rsync.rb
│ ├── debian
│ │ ├── guest.rb
│ │ └── cap
│ │ │ ├── rsync.rb
│ │ │ ├── nfs.rb
│ │ │ └── smb.rb
│ ├── mint
│ │ ├── guest.rb
│ │ └── plugin.rb
│ ├── openbsd
│ │ └── guest.rb
│ ├── photon
│ │ ├── guest.rb
│ │ └── cap
│ │ │ └── docker.rb
│ ├── suse
│ │ ├── cap
│ │ │ ├── network_scripts_dir.rb
│ │ │ ├── rsync.rb
│ │ │ ├── nfs_client.rb
│ │ │ └── halt.rb
│ │ └── guest.rb
│ ├── ubuntu
│ │ ├── guest.rb
│ │ └── plugin.rb
│ ├── atomic
│ │ ├── guest.rb
│ │ ├── cap
│ │ │ └── docker.rb
│ │ └── plugin.rb
│ ├── linux
│ │ └── cap
│ │ │ ├── port.rb
│ │ │ ├── rsync.rb
│ │ │ ├── halt.rb
│ │ │ ├── choose_addressable_ip_addr.rb
│ │ │ └── read_ip_address.rb
│ ├── coreos
│ │ ├── cap
│ │ │ └── docker.rb
│ │ └── guest.rb
│ ├── smartos
│ │ ├── guest.rb
│ │ └── config.rb
│ ├── tinycore
│ │ ├── guest.rb
│ │ └── cap
│ │ │ ├── change_host_name.rb
│ │ │ ├── halt.rb
│ │ │ └── rsync.rb
│ ├── darwin
│ │ ├── cap
│ │ │ ├── rsync.rb
│ │ │ ├── verify_vmware_hgfs.rb
│ │ │ ├── choose_addressable_ip_addr.rb
│ │ │ └── halt.rb
│ │ └── guest.rb
│ ├── elementary
│ │ ├── guest.rb
│ │ └── plugin.rb
│ ├── fedora
│ │ ├── guest.rb
│ │ ├── plugin.rb
│ │ └── cap
│ │ │ └── flavor.rb
│ ├── windows
│ │ ├── guest.rb
│ │ ├── scripts
│ │ │ ├── set_work_network.ps1
│ │ │ └── winrs_v3_get_adapters.ps1
│ │ ├── cap
│ │ │ ├── halt.rb
│ │ │ └── choose_addressable_ip_addr.rb
│ │ ├── config.rb
│ │ └── errors.rb
│ ├── trisquel
│ │ ├── guest.rb
│ │ └── plugin.rb
│ ├── nixos
│ │ ├── cap
│ │ │ └── nfs_client.rb
│ │ └── guest.rb
│ ├── freebsd
│ │ ├── cap
│ │ │ └── rsync.rb
│ │ └── guest.rb
│ ├── solaris
│ │ ├── guest.rb
│ │ └── cap
│ │ │ └── change_host_name.rb
│ └── solaris11
│ │ └── guest.rb
├── hosts
│ ├── windows
│ │ ├── cap
│ │ │ └── nfs.rb
│ │ └── host.rb
│ ├── arch
│ │ ├── host.rb
│ │ └── cap
│ │ │ └── nfs.rb
│ ├── alt
│ │ └── host.rb
│ ├── gentoo
│ │ └── host.rb
│ ├── darwin
│ │ ├── host.rb
│ │ └── scripts
│ │ │ └── install_virtualbox.sh
│ ├── null
│ │ ├── host.rb
│ │ └── plugin.rb
│ ├── freebsd
│ │ └── host.rb
│ ├── bsd
│ │ └── host.rb
│ ├── linux
│ │ └── host.rb
│ ├── slackware
│ │ ├── host.rb
│ │ └── cap
│ │ │ └── nfs.rb
│ └── suse
│ │ └── cap
│ │ └── nfs.rb
├── README.md
├── provisioners
│ ├── salt
│ │ ├── errors.rb
│ │ └── plugin.rb
│ ├── docker
│ │ └── cap
│ │ │ ├── debian
│ │ │ ├── docker_start_service.rb
│ │ │ └── docker_install.rb
│ │ │ ├── linux
│ │ │ ├── docker_daemon_running.rb
│ │ │ └── docker_configure_vagrant_user.rb
│ │ │ └── redhat
│ │ │ └── docker_start_service.rb
│ ├── cfengine
│ │ └── cap
│ │ │ ├── linux
│ │ │ └── cfengine_installed.rb
│ │ │ └── suse
│ │ │ └── cfengine_install.rb
│ ├── ansible
│ │ ├── constants.rb
│ │ ├── helpers.rb
│ │ └── cap
│ │ │ └── guest
│ │ │ ├── facts.rb
│ │ │ └── suse
│ │ │ └── ansible_install.rb
│ ├── chef
│ │ └── cap
│ │ │ ├── windows
│ │ │ └── chef_install.rb
│ │ │ ├── freebsd
│ │ │ └── chef_install.rb
│ │ │ └── debian
│ │ │ └── chef_install.rb
│ ├── file
│ │ └── plugin.rb
│ └── shell
│ │ └── plugin.rb
├── commands
│ ├── help
│ │ ├── command.rb
│ │ └── plugin.rb
│ ├── box
│ │ └── plugin.rb
│ ├── snapshot
│ │ └── plugin.rb
│ ├── cap
│ │ └── plugin.rb
│ ├── push
│ │ └── plugin.rb
│ ├── up
│ │ └── plugin.rb
│ ├── powershell
│ │ ├── scripts
│ │ │ └── reset_trustedhosts.ps1
│ │ └── errors.rb
│ ├── resume
│ │ └── plugin.rb
│ ├── ssh
│ │ └── plugin.rb
│ ├── validate
│ │ └── plugin.rb
│ ├── init
│ │ └── plugin.rb
│ ├── halt
│ │ └── plugin.rb
│ ├── rdp
│ │ └── errors.rb
│ ├── provider
│ │ └── plugin.rb
│ ├── reload
│ │ └── plugin.rb
│ ├── package
│ │ └── plugin.rb
│ ├── version
│ │ └── plugin.rb
│ ├── provision
│ │ └── plugin.rb
│ ├── list-commands
│ │ └── plugin.rb
│ ├── suspend
│ │ └── plugin.rb
│ ├── status
│ │ └── plugin.rb
│ ├── ssh_config
│ │ └── plugin.rb
│ ├── destroy
│ │ └── plugin.rb
│ ├── global-status
│ │ └── plugin.rb
│ ├── plugin
│ │ ├── plugin.rb
│ │ └── command
│ │ │ └── base.rb
│ ├── login
│ │ └── errors.rb
│ └── port
│ │ └── plugin.rb
├── kernel_v1
│ └── config
│ │ ├── package.rb
│ │ └── nfs.rb
├── kernel_v2
│ └── config
│ │ ├── package.rb
│ │ └── vagrant.rb
└── communicators
│ ├── winrm
│ └── command_filters
│ │ ├── chmod.rb
│ │ └── chown.rb
│ ├── winssh
│ └── plugin.rb
│ └── ssh
│ └── plugin.rb
├── website
├── Gemfile
├── source
│ ├── favicon.ico
│ ├── assets
│ │ ├── files
│ │ │ └── press-kit.zip
│ │ ├── images
│ │ │ ├── customers.png
│ │ │ ├── og-image.png
│ │ │ ├── favicons
│ │ │ │ ├── favicon.ico
│ │ │ │ ├── favicon-16x16.png
│ │ │ │ ├── favicon-32x32.png
│ │ │ │ ├── apple-touch-icon.png
│ │ │ │ ├── mstile-150x150.png
│ │ │ │ ├── android-chrome-192x192.png
│ │ │ │ └── android-chrome-512x512.png
│ │ │ └── systems
│ │ │ │ └── windows.svg
│ │ ├── javascripts
│ │ │ └── application.js
│ │ └── stylesheets
│ │ │ ├── _syntax.scss.erb
│ │ │ ├── _community.scss
│ │ │ └── _footer.scss
│ ├── robots.txt
│ ├── layouts
│ │ ├── downloads.erb
│ │ └── inner.erb
│ ├── microsoft-tile.xml.builder
│ ├── 404.html.md
│ ├── docs
│ │ ├── vagrant-cloud
│ │ │ ├── users
│ │ │ │ ├── index.html.md
│ │ │ │ └── recovery.html.md
│ │ │ └── organizations
│ │ │ │ ├── create.html.md
│ │ │ │ └── index.html.md
│ │ ├── other
│ │ │ └── index.html.md
│ │ ├── cli
│ │ │ ├── validate.html.md
│ │ │ ├── rsync.html.md
│ │ │ ├── ssh_config.html.md
│ │ │ └── status.html.md
│ │ └── providers
│ │ │ └── custom.html.md
│ ├── android-manifest.json.erb
│ └── sitemap.xml.builder
├── LICENSE.md
└── Makefile
├── .vimrc
├── tasks
├── bundler.rake
├── test.rake
└── acceptance.rake
├── Gemfile
├── lib
└── vagrant
│ ├── plugin.rb
│ ├── config
│ ├── v1.rb
│ ├── v2.rb
│ ├── v1
│ │ └── dummy_config.rb
│ └── v2
│ │ ├── dummy_config.rb
│ │ └── util.rb
│ ├── version.rb
│ ├── util
│ ├── file_mode.rb
│ ├── silence_warnings.rb
│ ├── line_ending_helpers.rb
│ ├── safe_env.rb
│ ├── shell_quote.rb
│ ├── deep_merge.rb
│ └── counter.rb
│ ├── plugin
│ ├── v1
│ │ └── errors.rb
│ └── v2
│ │ ├── errors.rb
│ │ └── host.rb
│ ├── action
│ └── builtin
│ │ ├── handle_box_url.rb
│ │ ├── box_update.rb
│ │ └── message.rb
│ └── host.rb
├── .travis.yml
├── keys
├── vagrant.pub
└── README.md
├── vagrant-spec.config.example.rb
└── Rakefile
/.yardopts:
--------------------------------------------------------------------------------
1 | -m markdown
2 |
--------------------------------------------------------------------------------
/version.txt:
--------------------------------------------------------------------------------
1 | 2.0.2.dev
2 |
--------------------------------------------------------------------------------
/test/vagrant-spec/boxes/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/templates/guests/openbsd/network_dhcp.erb:
--------------------------------------------------------------------------------
1 | dhcp
2 |
--------------------------------------------------------------------------------
/contrib/st/Ruby.sublime-settings:
--------------------------------------------------------------------------------
1 | {
2 | "extensions":
3 | [
4 | "Vagrantfile"
5 | ]
6 | }
7 |
--------------------------------------------------------------------------------
/plugins/synced_folders/smb/scripts/ps_version.ps1:
--------------------------------------------------------------------------------
1 | Write-Output $PSVersionTable.PSVersion.Major
2 |
--------------------------------------------------------------------------------
/website/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 |
3 | gem "middleman-hashicorp", "0.3.29"
4 |
--------------------------------------------------------------------------------
/templates/guests/openbsd/network_static.erb:
--------------------------------------------------------------------------------
1 | inet <%= options[:ip] %> <%= options[:netmask] %> NONE
2 |
--------------------------------------------------------------------------------
/.vimrc:
--------------------------------------------------------------------------------
1 | " tabstop settings
2 | set tabstop=2
3 | set softtabstop=2
4 | set shiftwidth=2
5 | set expandtab
6 |
--------------------------------------------------------------------------------
/website/source/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ramiro/vagrant/master/website/source/favicon.ico
--------------------------------------------------------------------------------
/test/acceptance/base.rb:
--------------------------------------------------------------------------------
1 | require "vagrant-spec/acceptance"
2 | require_relative "shared/context_virtualbox"
3 |
--------------------------------------------------------------------------------
/templates/guests/netbsd/network_dhcp.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | ifconfig_wm<%= options[:interface] %>=dhcp
3 | #VAGRANT-END
4 |
--------------------------------------------------------------------------------
/templates/guests/alt/network_ipv4address.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | <%= options[:ip] %>/<%= options[:netmask] %>
3 | #VAGRANT-END
4 |
--------------------------------------------------------------------------------
/tasks/bundler.rake:
--------------------------------------------------------------------------------
1 | # This installs the tasks that help with gem creation and
2 | # publishing.
3 | Bundler::GemHelper.install_tasks
4 |
--------------------------------------------------------------------------------
/website/source/assets/files/press-kit.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ramiro/vagrant/master/website/source/assets/files/press-kit.zip
--------------------------------------------------------------------------------
/website/source/assets/images/customers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ramiro/vagrant/master/website/source/assets/images/customers.png
--------------------------------------------------------------------------------
/website/source/assets/images/og-image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ramiro/vagrant/master/website/source/assets/images/og-image.png
--------------------------------------------------------------------------------
/website/source/robots.txt:
--------------------------------------------------------------------------------
1 | ---
2 | layout: false
3 | noindex: true
4 | ---
5 |
6 | User-agent: *
7 | Disallow: /404
8 | Disallow: /500
9 |
--------------------------------------------------------------------------------
/plugins/providers/docker/hostmachine/Vagrantfile:
--------------------------------------------------------------------------------
1 | Vagrant.configure("2") do |config|
2 | config.vm.box = "hashicorp/boot2docker"
3 | end
4 |
--------------------------------------------------------------------------------
/templates/guests/freebsd/network_dhcp.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | ifconfig_<%= options[:device] %>="DHCP"
3 | synchronous_dhclient="YES"
4 | #VAGRANT-END
5 |
--------------------------------------------------------------------------------
/templates/guests/nixos/hostname.erb:
--------------------------------------------------------------------------------
1 | { config, pkgs, ... }:
2 | {
3 | <% if name %>
4 | networking.hostName = "<%= name %>";
5 | <% end %>
6 | }
7 |
--------------------------------------------------------------------------------
/website/source/assets/images/favicons/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ramiro/vagrant/master/website/source/assets/images/favicons/favicon.ico
--------------------------------------------------------------------------------
/templates/guests/arch/network_dhcp.erb:
--------------------------------------------------------------------------------
1 | Description='A basic dhcp ethernet connection'
2 | Interface=<%= options[:device] %>
3 | Connection=ethernet
4 | IP=dhcp
5 |
--------------------------------------------------------------------------------
/website/source/assets/images/favicons/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ramiro/vagrant/master/website/source/assets/images/favicons/favicon-16x16.png
--------------------------------------------------------------------------------
/website/source/assets/images/favicons/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ramiro/vagrant/master/website/source/assets/images/favicons/favicon-32x32.png
--------------------------------------------------------------------------------
/templates/guests/alt/network_ipv4route.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | <% if options[:gateway] %>
3 | default via <%= options[:gateway] %>
4 | <% end %>
5 | #VAGRANT-END
6 |
--------------------------------------------------------------------------------
/website/source/assets/images/favicons/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ramiro/vagrant/master/website/source/assets/images/favicons/apple-touch-icon.png
--------------------------------------------------------------------------------
/website/source/assets/images/favicons/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ramiro/vagrant/master/website/source/assets/images/favicons/mstile-150x150.png
--------------------------------------------------------------------------------
/test/unit/vagrant/plugin/v1/host_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../../../../base", __FILE__)
2 |
3 | describe Vagrant::Plugin::V1::Host do
4 | # No tests.
5 | end
6 |
--------------------------------------------------------------------------------
/test/unit/vagrant/plugin/v2/communicator_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../../../../base", __FILE__)
2 |
3 | describe Vagrant::Plugin::V2::Communicator do
4 | end
5 |
--------------------------------------------------------------------------------
/test/unit/vagrant/plugin/v2/host_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../../../../base", __FILE__)
2 |
3 | describe Vagrant::Plugin::V2::Host do
4 | # No tests.
5 | end
6 |
--------------------------------------------------------------------------------
/templates/guests/funtoo/network_dhcp.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # The contents below are automatically generated by Vagrant. Do not modify.
3 | template='dhcp'
4 | #VAGRANT-END
5 |
--------------------------------------------------------------------------------
/test/acceptance/shared/context_virtualbox.rb:
--------------------------------------------------------------------------------
1 | shared_context "provider-context/virtualbox" do
2 | let(:extra_env) {{
3 | "VBOX_USER_HOME" => "{{homedir}}",
4 | }}
5 | end
6 |
--------------------------------------------------------------------------------
/website/source/assets/images/favicons/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ramiro/vagrant/master/website/source/assets/images/favicons/android-chrome-192x192.png
--------------------------------------------------------------------------------
/website/source/assets/images/favicons/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ramiro/vagrant/master/website/source/assets/images/favicons/android-chrome-512x512.png
--------------------------------------------------------------------------------
/templates/config/validation_failed.erb:
--------------------------------------------------------------------------------
1 | <% errors.each do |section, list| -%>
2 | <%= section %>:
3 | <% list.each do |error| -%>
4 | * <%= error %>
5 | <% end -%>
6 |
7 | <% end -%>
8 |
--------------------------------------------------------------------------------
/templates/guests/gentoo/network_dhcp.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # The contents below are automatically generated by Vagrant. Do not modify.
3 | config_<%= options[:device] %>="dhcp"
4 | #VAGRANT-END
5 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/scripts/delete_vm.ps1:
--------------------------------------------------------------------------------
1 | Param(
2 | [Parameter(Mandatory=$true)]
3 | [string]$VmId
4 | )
5 |
6 | $VM = Get-VM -Id $VmId -ErrorAction "Stop"
7 | Remove-VM $VM -Force
8 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/scripts/resume_vm.ps1:
--------------------------------------------------------------------------------
1 | Param(
2 | [Parameter(Mandatory=$true)]
3 | [string]$VmId
4 | )
5 |
6 | $VM = Get-VM -Id $VmId -ErrorAction "Stop"
7 | Resume-VM $VM
8 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/scripts/suspend_vm.ps1:
--------------------------------------------------------------------------------
1 | Param(
2 | [Parameter(Mandatory=$true)]
3 | [string]$VmId
4 | )
5 |
6 | $VM = Get-VM -Id $VmId -ErrorAction "Stop"
7 | Suspend-VM $VM
8 |
--------------------------------------------------------------------------------
/templates/guests/netbsd/network_static.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | ifconfig_wm<%= options[:interface] %>="media autoselect up;inet <%= options[:ip] %> netmask <%= options[:netmask] %>"
3 | #VAGRANT-END
4 |
--------------------------------------------------------------------------------
/website/source/assets/javascripts/application.js:
--------------------------------------------------------------------------------
1 | //= require jquery
2 | //= require turbolinks
3 |
4 | //= require hashicorp/mega-nav
5 | //= require hashicorp/sidebar
6 |
7 | //= require _vmware
8 |
--------------------------------------------------------------------------------
/test/acceptance/skeletons/linked_clone/Vagrantfile:
--------------------------------------------------------------------------------
1 | Vagrant.configure('2') do |config|
2 | config.vm.box = 'basic'
3 |
4 | config.vm.provider 'virtualbox' do |v|
5 | v.linked_clone = true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/test/unit/plugins/providers/virtualbox/base.rb:
--------------------------------------------------------------------------------
1 | # base test helper for virtualbox unit tests
2 |
3 | require_relative "../../../base"
4 | require_relative "support/shared/virtualbox_driver_version_4_x_examples"
5 |
--------------------------------------------------------------------------------
/plugins/pushes/noop/push.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module NoopDeploy
3 | class Push < Vagrant.plugin("2", :push)
4 | def push
5 | puts "pushed"
6 | end
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/templates/guests/suse/network_dhcp.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # The contents below are automatically generated by Vagrant. Do not modify.
3 | BOOTPROTO='dhcp'
4 | STARTMODE='auto'
5 | DEVICE='<%= options[:device] %>'
6 | #VAGRANT-END
7 |
--------------------------------------------------------------------------------
/test/acceptance/skeletons/network_intnet/Vagrantfile:
--------------------------------------------------------------------------------
1 | Vagrant.configure("2") do |config|
2 | config.vm.box = "box"
3 | config.vm.network "private_network",
4 | ip: "192.168.50.4",
5 | virtualbox__intnet: true
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/scripts/delete_snapshot.ps1:
--------------------------------------------------------------------------------
1 | Param(
2 | [Parameter(Mandatory=$true)]
3 | [string]$VmId,
4 | [string]$SnapName
5 | )
6 |
7 | $VM = Get-VM -Id $VmId -ErrorAction "Stop"
8 | Remove-VMSnapshot $VM -Name $SnapName
9 |
--------------------------------------------------------------------------------
/plugins/guests/pld/cap/flavor.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestPld
3 | module Cap
4 | class Flavor
5 | def self.flavor(machine)
6 | return :pld
7 | end
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/hosts/windows/cap/nfs.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HostWindows
3 | module Cap
4 | class NFS
5 | def self.nfs_installed(env)
6 | false
7 | end
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/scripts/create_snapshot.ps1:
--------------------------------------------------------------------------------
1 | Param(
2 | [Parameter(Mandatory=$true)]
3 | [string]$VmId,
4 | [string]$SnapName
5 | )
6 |
7 | $VM = Get-VM -Id $VmId -ErrorAction "Stop"
8 | Checkpoint-VM $VM -SnapshotName $SnapName
9 |
--------------------------------------------------------------------------------
/tasks/test.rake:
--------------------------------------------------------------------------------
1 | require 'rake/testtask'
2 | require 'rspec/core/rake_task'
3 |
4 | namespace :test do
5 | RSpec::Core::RakeTask.new(:unit) do |t|
6 | t.pattern = "test/unit/**/*_test.rb"
7 | t.rspec_opts = "--color"
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/templates/guests/alt/network_dhcp.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # The contents below are automatically generated by Vagrant. Do not modify.
3 | TYPE=eth
4 | NM_CONTROLLED=<%= options.fetch(:nm_controlled, "no") %>
5 | BOOTPROTO=dhcp
6 | ONBOOT=yes
7 | #VAGRANT-END
8 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/scripts/restore_snapshot.ps1:
--------------------------------------------------------------------------------
1 | Param(
2 | [Parameter(Mandatory=$true)]
3 | [string]$VmId,
4 | [string]$SnapName
5 | )
6 |
7 | $VM = Get-VM -Id $VmId -ErrorAction "Stop"
8 | Restore-VMSnapshot $VM -Name $SnapName -Confirm:$false
9 |
--------------------------------------------------------------------------------
/templates/guests/alt/network_static.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # The contents below are automatically generated by Vagrant. Do not modify.
3 | TYPE=eth
4 | NM_CONTROLLED=<%= options.fetch(:nm_controlled, "no") %>
5 | BOOTPROTO=static
6 | ONBOOT=yes
7 | #VAGRANT-END
8 |
--------------------------------------------------------------------------------
/templates/guests/freebsd/network_static.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | ifconfig_<%= options[:device] %>="inet <%= options[:ip] %> netmask <%= options[:netmask] %>"
3 | <% if options[:gateway] %>
4 | default_router="<%= options[:gateway] %>"
5 | <% end %>
6 | #VAGRANT-END
7 |
--------------------------------------------------------------------------------
/plugins/README.md:
--------------------------------------------------------------------------------
1 | # Vagrant Core Plugins
2 |
3 | These are plugins that ship with Vagrant. Vagrant core uses its own
4 | plugin system to power a lot of the core pieces that ship with Vagrant.
5 | Each plugin will have its own README which explains its specific role.
6 |
--------------------------------------------------------------------------------
/plugins/guests/pld/guest.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestPld
3 | class Guest < Vagrant.plugin("2", :guest)
4 | def detect?(machine)
5 | machine.communicate.test("cat /etc/pld-release")
6 | end
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/scripts/stop_vm.ps1:
--------------------------------------------------------------------------------
1 | Param(
2 | [Parameter(Mandatory=$true)]
3 | [string]$VmId
4 | )
5 |
6 | # Shuts down virtual machine regardless of any unsaved application data
7 | $VM = Get-VM -Id $VmId -ErrorAction "Stop"
8 | Stop-VM $VM -Force
9 |
--------------------------------------------------------------------------------
/website/source/assets/images/systems/windows.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/plugins/guests/alt/guest.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestALT
3 | class Guest < Vagrant.plugin("2", :guest)
4 | def detect?(machine)
5 | machine.communicate.test("cat /etc/altlinux-release")
6 | end
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/guests/bsd/guest.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestBSD
3 | class Guest < Vagrant.plugin("2", :guest)
4 | def detect?(machine)
5 | machine.communicate.test("uname -s | grep -i 'BSD'")
6 | end
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/hosts/arch/host.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module HostArch
5 | class Host < Vagrant.plugin("2", :host)
6 | def detect?(env)
7 | File.exist?("/etc/arch-release")
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/templates/nfs/exports.erb:
--------------------------------------------------------------------------------
1 | # VAGRANT-BEGIN: <%= user %> <%= uuid %>
2 | <% folders.each do |dirs, opts| %>
3 | <%= dirs.map { |d| "\"#{d}\"" }.join(" ") %> <%= ips.join(" ") %> <%=opts[:bsd__compiled_nfs_options] %>
4 | <% end %>
5 | # VAGRANT-END: <%= user %> <%= uuid %>
6 |
--------------------------------------------------------------------------------
/plugins/guests/redhat/guest.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestRedHat
3 | class Guest < Vagrant.plugin("2", :guest)
4 | def detect?(machine)
5 | machine.communicate.test("cat /etc/redhat-release")
6 | end
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/hosts/alt/host.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module HostALT
5 | class Host < Vagrant.plugin("2", :host)
6 | def detect?(env)
7 | File.exist?("/etc/altlinux-release")
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/scripts/clone_vhd.ps1:
--------------------------------------------------------------------------------
1 | Param(
2 | [Parameter(Mandatory=$true)]
3 | [string]$Source,
4 |
5 | [Parameter(Mandatory=$true)]
6 | [string]$Destination
7 | )
8 |
9 | New-VHD -Path $Destination -ParentPath $Source -ErrorAction Stop
10 |
--------------------------------------------------------------------------------
/templates/guests/freebsd/network_static6.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | ifconfig_<%= options[:device] %>_ipv6="inet6 <%= options[:ip] %> prefixlen <%= options[:netmask] %>"
3 | <% if options[:gateway] %>
4 | ipv6_default_router="<%= options[:gateway] %>"
5 | <% end %>
6 | #VAGRANT-END
7 |
--------------------------------------------------------------------------------
/templates/nfs/exports_freebsd.erb:
--------------------------------------------------------------------------------
1 | # VAGRANT-BEGIN: <%= user %> <%= uuid %>
2 | <% folders.each do |dirs, opts| %>
3 | <%= dirs.map { |d| "#{d}" }.join(" ") %> <%=opts[:bsd__compiled_nfs_options] %> <%= ips.join(" ") %>
4 | <% end %>
5 | # VAGRANT-END: <%= user %> <%= uuid %>
6 |
--------------------------------------------------------------------------------
/test/vagrant-spec/scripts/centos-run.virtualbox.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -x
3 |
4 | export VAGRANT_SPEC_BOX="${VAGRANT_SPEC_BOX}"
5 | vagrant vagrant-spec ${VAGRANT_SPEC_ARGS} /vagrant/test/vagrant-spec/configs/vagrant-spec.config.virtualbox.rb
6 | result=$?
7 |
8 | exit $result
9 |
--------------------------------------------------------------------------------
/test/vagrant-spec/scripts/ubuntu-run.virtualbox.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -x
3 |
4 | export VAGRANT_SPEC_BOX="${VAGRANT_SPEC_BOX}"
5 | vagrant vagrant-spec ${VAGRANT_SPEC_ARGS} /vagrant/test/vagrant-spec/configs/vagrant-spec.config.virtualbox.rb
6 | result=$?
7 |
8 | exit $result
9 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 |
3 | gemspec
4 |
5 | if File.exist?(File.expand_path("../../vagrant-spec", __FILE__))
6 | gem 'vagrant-spec', path: "../vagrant-spec"
7 | else
8 | gem 'vagrant-spec', git: "https://github.com/mitchellh/vagrant-spec.git"
9 | end
10 |
--------------------------------------------------------------------------------
/lib/vagrant/plugin.rb:
--------------------------------------------------------------------------------
1 | module Vagrant
2 | module Plugin
3 | autoload :V1, "vagrant/plugin/v1"
4 | autoload :V2, "vagrant/plugin/v2"
5 | autoload :Manager, "vagrant/plugin/manager"
6 | autoload :StateFile, "vagrant/plugin/state_file"
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/guests/funtoo/guest.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestFuntoo
3 | class Guest < Vagrant.plugin("2", :guest)
4 | def detect?(machine)
5 | machine.communicate.test("grep Funtoo /etc/gentoo-release")
6 | end
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/guests/gentoo/guest.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestGentoo
3 | class Guest < Vagrant.plugin("2", :guest)
4 | def detect?(machine)
5 | machine.communicate.test("grep Gentoo /etc/gentoo-release")
6 | end
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/hosts/gentoo/host.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module HostGentoo
5 | class Host < Vagrant.plugin("2", :host)
6 | def detect?(env)
7 | File.exists?("/etc/gentoo-release")
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/templates/guests/redhat/network_dhcp.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # The contents below are automatically generated by Vagrant. Do not modify.
3 | BOOTPROTO=dhcp
4 | ONBOOT=yes
5 | DEVICE=<%= options[:device] %>
6 | NM_CONTROLLED=<%= options.fetch(:nm_controlled, "no") %>
7 | #VAGRANT-END
8 |
--------------------------------------------------------------------------------
/test/vagrant-spec/scripts/ubuntu-setup.virtualbox.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -xe
3 |
4 | apt-get update -q
5 | apt-get install -qy virtualbox
6 |
7 | pushd /vagrant
8 |
9 | dpkg -i ./pkg/dist/vagrant_*_x86_64.deb
10 | vagrant plugin install ./vagrant-spec.gem
11 |
12 | popd
13 |
--------------------------------------------------------------------------------
/plugins/guests/alt/cap/network_scripts_dir.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestALT
3 | module Cap
4 | class NetworkScriptsDir
5 | def self.network_scripts_dir(machine)
6 | "/etc/net"
7 | end
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/omnios/guest.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestOmniOS
3 | class Guest < Vagrant.plugin("2", :guest)
4 | def detect?(machine)
5 | machine.communicate.test("cat /etc/release | grep -i OmniOS")
6 | end
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/guests/slackware/guest.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestSlackware
3 | class Guest < Vagrant.plugin("2", :guest)
4 | def detect?(machine)
5 | machine.communicate.test("cat /etc/slackware-version")
6 | end
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/provisioners/salt/errors.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module Salt
5 | module Errors
6 | class SaltError < Vagrant::Errors::VagrantError
7 | error_namespace("vagrant.provisioners.salt")
8 | end
9 | end
10 | end
11 | end
--------------------------------------------------------------------------------
/lib/vagrant/config/v1.rb:
--------------------------------------------------------------------------------
1 | module Vagrant
2 | module Config
3 | module V1
4 | autoload :DummyConfig, "vagrant/config/v1/dummy_config"
5 | autoload :Loader, "vagrant/config/v1/loader"
6 | autoload :Root, "vagrant/config/v1/root"
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/lib/vagrant/config/v2.rb:
--------------------------------------------------------------------------------
1 | module Vagrant
2 | module Config
3 | module V2
4 | autoload :DummyConfig, "vagrant/config/v2/dummy_config"
5 | autoload :Loader, "vagrant/config/v2/loader"
6 | autoload :Root, "vagrant/config/v2/root"
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/guests/amazon/guest.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestAmazon
3 | class Guest < Vagrant.plugin("2", :guest)
4 | def detect?(machine)
5 | machine.communicate.test("grep 'Amazon Linux AMI' /etc/os-release")
6 | end
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/hosts/darwin/host.rb:
--------------------------------------------------------------------------------
1 | require "vagrant/util/platform"
2 |
3 | module VagrantPlugins
4 | module HostDarwin
5 | class Host < Vagrant.plugin("2", :host)
6 | def detect?(env)
7 | Vagrant::Util::Platform.darwin?
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/templates/guests/slackware/network_dhcp.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # Config for eth<%= i %>
3 | USE_DHCP[<%= i %>]="yes"
4 | DHCP_HOSTNAME[<%= i %>]=""
5 |
6 | <% if options[:gateway] -%>
7 | GATEWAY="<%= options[:gateway] %>"
8 | <% end -%>
9 |
10 | DEBUG_ETH_UP="no"
11 | #VAGRANT-END
12 |
--------------------------------------------------------------------------------
/templates/nfs/exports_linux.erb:
--------------------------------------------------------------------------------
1 | # VAGRANT-BEGIN: <%= user %> <%= uuid %>
2 | <% ips.each do |ip| %>
3 | <% folders.each do |name, opts| %>
4 | "<%= opts[:hostpath] %>" <%= ip %>(<%= opts[:linux__nfs_options].join(",") %>)
5 | <% end %>
6 | <% end %>
7 | # VAGRANT-END: <%= user %> <%= uuid %>
8 |
--------------------------------------------------------------------------------
/contrib/vim/vagrantfile.vim:
--------------------------------------------------------------------------------
1 | " Teach vim to syntax highlight Vagrantfile as ruby
2 | "
3 | " Install: $HOME/.vim/plugin/vagrant.vim
4 | " Author: Brandon Philips
5 |
6 | augroup vagrant
7 | au!
8 | au BufRead,BufNewFile Vagrantfile set filetype=ruby
9 | augroup END
10 |
--------------------------------------------------------------------------------
/plugins/guests/arch/guest.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestArch
5 | class Guest < Vagrant.plugin("2", :guest)
6 | def detect?(machine)
7 | machine.communicate.test("cat /etc/arch-release")
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/dragonflybsd/guest.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestDragonFlyBSD
3 | class Guest < Vagrant.plugin("2", :guest)
4 | def detect?(machine)
5 | machine.communicate.test("uname -s | grep -i 'DragonFly'")
6 | end
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/guests/omnios/cap/rsync.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestOmniOS
3 | module Cap
4 | class RSync
5 | def self.rsync_install(machine)
6 | machine.communicate.sudo("pkg install rsync")
7 | end
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/esxi/guest.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestEsxi
5 | class Guest < Vagrant.plugin("2", :guest)
6 | def detect?(machine)
7 | machine.communicate.test("uname -s | grep VMkernel")
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/haiku/guest.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestHaiku
5 | class Guest < Vagrant.plugin("2", :guest)
6 | def detect?(machine)
7 | machine.communicate.test("uname -o | grep 'Haiku'")
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/kali/guest.rb:
--------------------------------------------------------------------------------
1 | require_relative '../linux/guest'
2 |
3 | module VagrantPlugins
4 | module GuestKali
5 | class Guest < VagrantPlugins::GuestLinux::Guest
6 | # Name used for guest detection
7 | GUEST_DETECTION_NAME = "kali".freeze
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/guests/netbsd/guest.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestNetBSD
5 | class Guest < Vagrant.plugin("2", :guest)
6 | def detect?(machine)
7 | machine.communicate.test("uname -s | grep NetBSD")
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/hosts/null/host.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module HostNull
5 | class Host < Vagrant.plugin("2", :host)
6 | def detect?(env)
7 | # This host can only be explicitly chosen.
8 | false
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/contrib/sudoers/osx:
--------------------------------------------------------------------------------
1 | Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
2 | Cmnd_Alias VAGRANT_NFSD = /sbin/nfsd restart
3 | Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /usr/bin/sed -E -e /*/ d -ibak /etc/exports
4 | %admin ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD, VAGRANT_EXPORTS_REMOVE
5 |
6 |
--------------------------------------------------------------------------------
/plugins/guests/debian/guest.rb:
--------------------------------------------------------------------------------
1 | require_relative '../linux/guest'
2 |
3 | module VagrantPlugins
4 | module GuestDebian
5 | class Guest < VagrantPlugins::GuestLinux::Guest
6 | # Name used for guest detection
7 | GUEST_DETECTION_NAME = "debian".freeze
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/guests/mint/guest.rb:
--------------------------------------------------------------------------------
1 | require_relative '../linux/guest'
2 |
3 | module VagrantPlugins
4 | module GuestMint
5 | class Guest < VagrantPlugins::GuestLinux::Guest
6 | # Name used for guest detection
7 | GUEST_DETECTION_NAME = "Linux Mint".freeze
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/guests/openbsd/guest.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestOpenBSD
5 | class Guest < Vagrant.plugin("2", :guest)
6 | def detect?(machine)
7 | machine.communicate.test("uname -s | grep 'OpenBSD'")
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/photon/guest.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestPhoton
3 | class Guest < Vagrant.plugin("2", :guest)
4 | def detect?(machine)
5 | machine.communicate.test("cat /etc/photon-release | grep 'VMware Photon Linux'")
6 | end
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/guests/pld/cap/network_scripts_dir.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestPld
3 | module Cap
4 | class NetworkScriptsDir
5 | def self.network_scripts_dir(machine)
6 | "/etc/sysconfig/interfaces"
7 | end
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/suse/cap/network_scripts_dir.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestSUSE
3 | module Cap
4 | class NetworkScriptsDir
5 | def self.network_scripts_dir(machine)
6 | "/etc/sysconfig/network"
7 | end
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/suse/guest.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestSUSE
3 | class Guest < Vagrant.plugin("2", :guest)
4 | def detect?(machine)
5 | machine.communicate.test("test -f /etc/SuSE-release || grep -q SUSE /etc/os-release")
6 | end
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/guests/ubuntu/guest.rb:
--------------------------------------------------------------------------------
1 | require_relative '../linux/guest'
2 |
3 | module VagrantPlugins
4 | module GuestUbuntu
5 | class Guest < VagrantPlugins::GuestLinux::Guest
6 | # Name used for guest detection
7 | GUEST_DETECTION_NAME = "ubuntu".freeze
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/cap/snapshot_list.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HyperV
3 | module Cap
4 | module SnapshotList
5 | def self.snapshot_list(machine)
6 | machine.provider.driver.list_snapshots
7 | end
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/templates/config/messages.erb:
--------------------------------------------------------------------------------
1 | <% if !warnings.empty? -%>
2 | Warnings:
3 | <% warnings.each do |warning| -%>
4 | * <%= warning %>
5 | <% end -%>
6 |
7 | <% end -%>
8 | <% if !errors.empty? -%>
9 | Errors:
10 | <% errors.each do |error| -%>
11 | * <%= error %>
12 | <% end -%>
13 |
14 | <% end -%>
15 |
--------------------------------------------------------------------------------
/plugins/guests/atomic/guest.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestAtomic
5 | class Guest < Vagrant.plugin("2", :guest)
6 | def detect?(machine)
7 | machine.communicate.test("grep 'ostree=' /proc/cmdline")
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/linux/cap/port.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestLinux
3 | module Cap
4 | class Port
5 | def self.port_open_check(machine, port)
6 | machine.communicate.test("nc -z -w2 127.0.0.1 #{port}")
7 | end
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/templates/guests/arch/network_static.erb:
--------------------------------------------------------------------------------
1 | Connection=ethernet
2 | Description='A basic static ethernet connection'
3 | Interface=<%= options[:device] %>
4 | IP=static
5 | Address=('<%= options[:ip]%>/<%= options[:netmask] %>')
6 | <% if options[:gateway] -%>
7 | Gateway='<%= options[:gateway] %>'
8 | <% end -%>
9 |
--------------------------------------------------------------------------------
/templates/guests/arch/network_static6.erb:
--------------------------------------------------------------------------------
1 | Connection=ethernet
2 | Description='A basic IPv6 ethernet connection'
3 | Interface=<%= options[:device] %>
4 | IP6=static
5 | Address6=('<%= options[:ip]%>/<%= options[:netmask] %>')
6 | <% if options[:gateway] -%>
7 | Gateway6='<%= options[:gateway] %>'
8 | <% end -%>
9 |
--------------------------------------------------------------------------------
/plugins/guests/atomic/cap/docker.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestAtomic
3 | module Cap
4 | module Docker
5 | def self.docker_daemon_running(machine)
6 | machine.communicate.test("test -S /run/docker.sock")
7 | end
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/coreos/cap/docker.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestCoreOS
3 | module Cap
4 | module Docker
5 | def self.docker_daemon_running(machine)
6 | machine.communicate.test("test -S /run/docker.sock")
7 | end
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/coreos/guest.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestCoreOS
5 | class Guest < Vagrant.plugin("2", :guest)
6 | def detect?(machine)
7 | machine.communicate.test("cat /etc/os-release | grep ID=coreos")
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/photon/cap/docker.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestPhoton
3 | module Cap
4 | module Docker
5 | def self.docker_daemon_running(machine)
6 | machine.communicate.test('test -S /run/docker.sock')
7 | end
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/redhat/cap/network_scripts_dir.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestRedHat
3 | module Cap
4 | class NetworkScriptsDir
5 | def self.network_scripts_dir(machine)
6 | "/etc/sysconfig/network-scripts"
7 | end
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/smartos/guest.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestSmartos
5 | class Guest < Vagrant.plugin("2", :guest)
6 | def detect?(machine)
7 | machine.communicate.test("cat /etc/release | grep -i SmartOS")
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/tinycore/guest.rb:
--------------------------------------------------------------------------------
1 | require_relative '../linux/guest'
2 |
3 | module VagrantPlugins
4 | module GuestTinyCore
5 | class Guest < VagrantPlugins::GuestLinux::Guest
6 | # Name used for guest detection
7 | GUEST_DETECTION_NAME = "Core Linux".freeze
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/hosts/freebsd/host.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 | require 'vagrant/util/platform'
3 |
4 | module VagrantPlugins
5 | module HostFreeBSD
6 | class Host < Vagrant.plugin("2", :host)
7 | def detect?(env)
8 | Vagrant::Util::Platform.freebsd?
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/templates/commands/init/Vagrantfile.min.erb:
--------------------------------------------------------------------------------
1 | Vagrant.configure("2") do |config|
2 | config.vm.box = "<%= box_name %>"
3 | <% if box_version -%>
4 | config.vm.box_version = "<%= box_version %>"
5 | <% end -%>
6 | <% if box_url -%>
7 | config.vm.box_url = "<%= box_url %>"
8 | <% end -%>
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/guests/darwin/cap/rsync.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../synced_folders/rsync/default_unix_cap"
2 |
3 | module VagrantPlugins
4 | module GuestDarwin
5 | module Cap
6 | class RSync
7 | extend VagrantPlugins::SyncedFolderRSync::DefaultUnixCap
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/elementary/guest.rb:
--------------------------------------------------------------------------------
1 | require_relative '../linux/guest'
2 |
3 | module VagrantPlugins
4 | module GuestElementary
5 | class Guest < VagrantPlugins::GuestLinux::Guest
6 | # Name used for guest detection
7 | GUEST_DETECTION_NAME = "elementary".freeze
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/guests/fedora/guest.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestFedora
5 | class Guest < Vagrant.plugin("2", :guest)
6 | def detect?(machine)
7 | machine.communicate.test("grep 'Fedora release' /etc/redhat-release")
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/guests/linux/cap/rsync.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../synced_folders/rsync/default_unix_cap"
2 |
3 | module VagrantPlugins
4 | module GuestLinux
5 | module Cap
6 | class RSync
7 | extend VagrantPlugins::SyncedFolderRSync::DefaultUnixCap
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/hosts/bsd/host.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module HostBSD
5 | # Represents a BSD host, such as FreeBSD.
6 | class Host < Vagrant.plugin("2", :host)
7 | def detect?(env)
8 | Vagrant::Util::Platform.darwin?
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/plugins/hosts/windows/host.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | require 'vagrant/util/platform'
4 |
5 | module VagrantPlugins
6 | module HostWindows
7 | class Host < Vagrant.plugin("2", :host)
8 | def detect?(env)
9 | Vagrant::Util::Platform.windows?
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/lib/vagrant/version.rb:
--------------------------------------------------------------------------------
1 | module Vagrant
2 | # This will always be up to date with the current version of Vagrant,
3 | # since it is used to generate the gemspec and is also the source of
4 | # the version for `vagrant -v`
5 | VERSION = File.read(
6 | File.expand_path("../../../version.txt", __FILE__)).chomp
7 | end
8 |
--------------------------------------------------------------------------------
/test/unit/vagrant/plugin/v1/communicator_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../../../../base", __FILE__)
2 |
3 | describe Vagrant::Plugin::V1::Communicator do
4 | let(:machine) { Object.new }
5 |
6 | it "should not match by default" do
7 | expect(described_class.match?(machine)).not_to be
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/guests/windows/guest.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestWindows
3 | class Guest < Vagrant.plugin("2", :guest)
4 | def detect?(machine)
5 | # See if the Windows directory is present.
6 | machine.communicate.test("test -d $Env:SystemRoot")
7 | end
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/hosts/linux/host.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module HostLinux
5 | # Represents a Linux based host, such as Ubuntu.
6 | class Host < Vagrant.plugin("2", :host)
7 | def detect?(env)
8 | Vagrant::Util::Platform.linux?
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/website/source/assets/stylesheets/_syntax.scss.erb:
--------------------------------------------------------------------------------
1 | pre.highlight code {
2 | color: #333333;
3 | }
4 |
5 | <%= Rouge::Themes::Github.render(scope: ".highlight") %>
6 |
7 | pre.highlight {
8 | border: 1px solid #CCCCCC;
9 | }
10 |
11 | pre.highlight code span.c1 {
12 | font-style: normal;
13 | opacity: 0.8;
14 | }
15 |
--------------------------------------------------------------------------------
/plugins/guests/trisquel/guest.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestTrisquel
3 | class Guest < Vagrant.plugin("2", :guest)
4 | def detect?(machine)
5 | machine.communicate.test("[ -x /usr/bin/lsb_release ] && /usr/bin/lsb_release -i 2>/dev/null | grep Trisquel")
6 | end
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/website/source/layouts/downloads.erb:
--------------------------------------------------------------------------------
1 | <% wrap_layout :inner do %>
2 | <% content_for :sidebar do %>
3 |
8 | <% end %>
9 |
10 | <%= yield %>
11 | <% end %>
12 |
--------------------------------------------------------------------------------
/plugins/guests/nixos/cap/nfs_client.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestNixos
3 | module Cap
4 | class NFSClient
5 | def self.nfs_client_installed(machine)
6 | machine.communicate.test("test -x /run/current-system/sw/sbin/mount.nfs")
7 | end
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/website/source/microsoft-tile.xml.builder:
--------------------------------------------------------------------------------
1 | ---
2 | layout: false
3 | noindex: true
4 | ---
5 |
6 | xml.instruct!
7 | xml.browserconfig do
8 | xml.msapplication do
9 | xml.tile do
10 | xml.square150x150logo src: image_path("favicons/mstile-150x150.png")
11 | xml.TileColor "#2D89EF"
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/templates/guests/gentoo/network_static6.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # The contents below are automatically generated by Vagrant. Do not modify.
3 | config_<%= options[:device] %>="<%= options[:ip] %>/<%= options[:netmask] %>"
4 | <% if options[:gateway] -%>
5 | gateways_<%= options[:device] %>="<%= options[:gateway] %>"
6 | <% end -%>
7 | #VAGRANT-END
8 |
--------------------------------------------------------------------------------
/lib/vagrant/util/file_mode.rb:
--------------------------------------------------------------------------------
1 | module Vagrant
2 | module Util
3 | class FileMode
4 | # This returns the file permissions as a string from
5 | # an octal number.
6 | def self.from_octal(octal)
7 | perms = sprintf("%o", octal)
8 | perms.reverse[0..2].reverse
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/templates/guests/funtoo/network_static6.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | template='interface'
3 | ipaddr='<%= options[:ip] %>/<%= options[:netmask] %>'
4 | <% [:gateway, :nameservers, :domain, :route, :gateway6, :route6, :mtu].each do |key| %>
5 | <% if options[key] %>
6 | <%= key %>='<%= options[key] %>'
7 | <% end %>
8 | <% end %>
9 | #VAGRANT-END
10 |
--------------------------------------------------------------------------------
/plugins/hosts/slackware/host.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module HostSlackware
5 | class Host < Vagrant.plugin("2", :host)
6 | def detect?(env)
7 | return File.exists?("/etc/slackware-version") ||
8 | !Dir.glob("/usr/lib/setup/Plamo-*").empty?
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/plugins/providers/docker/cap/proxy_machine.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module DockerProvider
3 | module Cap
4 | module ProxyMachine
5 | def self.proxy_machine(machine)
6 | return nil if !machine.provider.host_vm?
7 | machine.provider.host_vm
8 | end
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/templates/guests/gentoo/network_static.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # The contents below are automatically generated by Vagrant. Do not modify.
3 | config_<%= options[:device] %>=("<%= options[:ip] %> netmask <%= options[:netmask] %>")
4 | <% if options[:gateway] -%>
5 | gateways_<%= options[:device] %>="<%= options[:gateway] %>"
6 | <% end -%>
7 | #VAGRANT-END
8 |
--------------------------------------------------------------------------------
/plugins/hosts/darwin/scripts/install_virtualbox.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | hdiutil attach $1
5 | cd /Volumes/VirtualBox/
6 | sudo installer -pkg VirtualBox.pkg -target "/"
7 | cd /tmp
8 | flag=1
9 | while [ $flag -ne 0 ]; do
10 | sleep 1
11 | set +e
12 | hdiutil detach /Volumes/VirtualBox/
13 | flag=$?
14 | set -e
15 | done
16 |
--------------------------------------------------------------------------------
/plugins/pushes/atlas/errors.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module AtlasPush
3 | module Errors
4 | class Error < Vagrant::Errors::VagrantError
5 | error_namespace("atlas_push.errors")
6 | end
7 |
8 | class UploaderNotFound < Error
9 | error_key(:uploader_not_found)
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/website/source/404.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: "inner"
3 | page_title: "Not Found"
4 | noindex: true
5 | description: |-
6 | Page not found!
7 | ---
8 |
9 | # Page Not Found
10 |
11 | Sorry, the page you tried to visit does not exist. This could be our fault,
12 | and if so we will fix that up right away.
13 |
14 | Please go back to get back on track.
15 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: ruby
2 |
3 | sudo: false
4 |
5 | cache: bundler
6 |
7 | addons:
8 | apt:
9 | packages:
10 | - bsdtar
11 |
12 | rvm:
13 | - 2.3.5
14 | - 2.4.2
15 |
16 | branches:
17 | only:
18 | - master
19 |
20 | env:
21 | global:
22 | - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
23 |
24 | script: bundle exec rake test:unit
25 |
--------------------------------------------------------------------------------
/lib/vagrant/util/silence_warnings.rb:
--------------------------------------------------------------------------------
1 | module Vagrant
2 | module Util
3 | module SilenceWarnings
4 | # This silences any Ruby warnings.
5 | def self.silence!
6 | original = $VERBOSE
7 | $VERBOSE = nil
8 | return yield
9 | ensure
10 | $VERBOSE = original
11 | end
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/plugins/pushes/local-exec/errors.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module LocalExecPush
3 | module Errors
4 | class Error < Vagrant::Errors::VagrantError
5 | error_namespace("local_exec_push.errors")
6 | end
7 |
8 | class CommandFailed < Error
9 | error_key(:command_failed)
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/plugins/guests/alt/cap/rsync.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestALT
3 | module Cap
4 | class RSync
5 | def self.rsync_install(machine)
6 | machine.communicate.sudo <<-EOH.gsub(/^ {12}/, '')
7 | apt-get install -y -qq install rsync
8 | EOH
9 | end
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/plugins/guests/kali/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestKali
5 | class Plugin < Vagrant.plugin("2")
6 | name "Kali guest"
7 | description "Kali guest support."
8 |
9 | guest(:kali, :debian) do
10 | require_relative "guest"
11 | Guest
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/guests/mint/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestMint
5 | class Plugin < Vagrant.plugin("2")
6 | name "Mint guest"
7 | description "Mint guest support."
8 |
9 | guest(:mint, :ubuntu) do
10 | require_relative "guest"
11 | Guest
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/templates/guests/coreos/etcd.service.erb:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=Clustered etcd
3 | #After=docker.service
4 |
5 | [Service]
6 | Restart=always
7 | ExecStart=/usr/bin/etcd -c 4001 -s 7001 -h <%= options[:my_ip] %> <% if options[:connection_string] %>-C <%= options[:connection_string] %><% end %> -d /home/core/etcd
8 |
9 | [Install]
10 | WantedBy=local.target
11 |
--------------------------------------------------------------------------------
/plugins/hosts/null/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module HostNull
5 | class Plugin < Vagrant.plugin("2")
6 | name "null host"
7 | description "A host that implements no capabilities."
8 |
9 | host("null") do
10 | require_relative "host"
11 | Host
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/guests/ubuntu/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestUbuntu
5 | class Plugin < Vagrant.plugin("2")
6 | name "Ubuntu guest"
7 | description "Ubuntu guest support."
8 |
9 | guest(:ubuntu, :debian) do
10 | require_relative "guest"
11 | Guest
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/pushes/noop/config.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module NoopDeploy
3 | class Config < Vagrant.plugin("2", :config)
4 | def initialize
5 | end
6 |
7 | def finalize!
8 | end
9 |
10 | def validate(machine)
11 | errors = _detected_errors
12 | { "Noop push" => errors }
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/templates/guests/slackware/network_static.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # Config for eth<%= i %>
3 | IPADDR[<%= i %>]="<%= options[:ip] %>"
4 | NETMASK[<%= i %>]="<%= options[:ip] %>"
5 | USE_DHCP[<%= i %>]=""
6 | DHCP_HOSTNAME[<%= i %>]=""
7 |
8 | <% if options[:gateway] -%>
9 | GATEWAY="<%= options[:gateway] %>"
10 | <% end -%>
11 |
12 | DEBUG_ETH_UP="no"
13 | #VAGRANT-END
14 |
--------------------------------------------------------------------------------
/plugins/guests/windows/scripts/set_work_network.ps1:
--------------------------------------------------------------------------------
1 | # Get network connections
2 | $networkListManager = [Activator]::CreateInstance([Type]::GetTypeFromCLSID([Guid]"{DCB00C01-570F-4A9B-8D69-199FDBA5723B}"))
3 | $connections = $networkListManager.GetNetworkConnections()
4 |
5 | # Set network location to Private for all networks
6 | $connections | % {$_.GetNetwork().SetCategory(1)}
7 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/scripts/list_snapshots.ps1:
--------------------------------------------------------------------------------
1 | Param(
2 | [Parameter(Mandatory=$true)]
3 | [string]$VmId
4 | )
5 |
6 | $VM = Get-VM -Id $VmId -ErrorAction "Stop"
7 | $Snapshots = @(Get-VMSnapshot $VM | Select-Object Name)
8 | $result = ConvertTo-json $Snapshots
9 |
10 | Write-Host "===Begin-Output==="
11 | Write-Host $result
12 | Write-Host "===End-Output==="
13 |
--------------------------------------------------------------------------------
/plugins/guests/trisquel/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestTrisquel
5 | class Plugin < Vagrant.plugin("2")
6 | name "Trisquel guest"
7 | description "Trisquel guest support."
8 |
9 | guest(:trisquel, :ubuntu) do
10 | require_relative "guest"
11 | Guest
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/hosts/slackware/cap/nfs.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HostSlackware
3 | module Cap
4 | class NFS
5 | def self.nfs_check_command(env)
6 | "/sbin/pidof nfsd >/dev/null"
7 | end
8 |
9 | def self.nfs_start_command(env)
10 | "/etc/rc.d/rc.nfsd start"
11 | end
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/test/unit/plugins/pushes/noop/config_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../base"
2 |
3 | require Vagrant.source_root.join("plugins/pushes/noop/config")
4 |
5 | describe VagrantPlugins::NoopDeploy::Config do
6 | include_context "unit"
7 |
8 | subject { described_class.new }
9 |
10 | let(:machine) { double("machine") }
11 |
12 | describe "#validate" do
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/test/unit/vagrant/util/shell_quote_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../../../base", __FILE__)
2 |
3 | require "vagrant/util/shell_quote"
4 |
5 | describe Vagrant::Util::ShellQuote do
6 | subject { described_class }
7 |
8 | it "quotes properly" do
9 | expected = "foo '\\''bar'\\''"
10 | expect(subject.escape("foo 'bar'", "'")).to eql(expected)
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/test/unit/plugins/providers/virtualbox/driver/version_4_0_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../base"
2 |
3 | describe VagrantPlugins::ProviderVirtualBox::Driver::Version_4_0 do
4 | include_context "virtualbox"
5 | let(:vbox_version) { "4.0.0" }
6 | subject { VagrantPlugins::ProviderVirtualBox::Driver::Meta.new(uuid) }
7 |
8 | it_behaves_like "a version 4.x virtualbox driver"
9 | end
10 |
--------------------------------------------------------------------------------
/test/unit/plugins/providers/virtualbox/driver/version_4_1_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../base"
2 |
3 | describe VagrantPlugins::ProviderVirtualBox::Driver::Version_4_1 do
4 | include_context "virtualbox"
5 | let(:vbox_version) { "4.1.0" }
6 | subject { VagrantPlugins::ProviderVirtualBox::Driver::Meta.new(uuid) }
7 |
8 | it_behaves_like "a version 4.x virtualbox driver"
9 | end
10 |
--------------------------------------------------------------------------------
/test/unit/plugins/providers/virtualbox/driver/version_4_2_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../base"
2 |
3 | describe VagrantPlugins::ProviderVirtualBox::Driver::Version_4_2 do
4 | include_context "virtualbox"
5 | let(:vbox_version) { "4.2.0" }
6 | subject { VagrantPlugins::ProviderVirtualBox::Driver::Meta.new(uuid) }
7 |
8 | it_behaves_like "a version 4.x virtualbox driver"
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/guests/elementary/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestElementary
5 | class Plugin < Vagrant.plugin("2")
6 | name "Elementary guest"
7 | description "Elementary guest support."
8 |
9 | guest(:elementary, :ubuntu) do
10 | require_relative "guest"
11 | Guest
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/test/unit/support/shared/plugin_command_context.rb:
--------------------------------------------------------------------------------
1 | shared_context "command plugin helpers" do
2 | def command_lambda(name, result, **opts)
3 | lambda do
4 | Class.new(Vagrant.plugin("2", "command")) do
5 | define_method(:execute) do
6 | raise opts[:exception] if opts[:exception]
7 | result
8 | end
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/plugins/provisioners/docker/cap/debian/docker_start_service.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module DockerProvisioner
3 | module Cap
4 | module Debian
5 | module DockerStartService
6 | def self.docker_start_service(machine)
7 | machine.communicate.sudo("service docker start")
8 | end
9 | end
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/test/unit/plugins/providers/virtualbox/driver/version_4_3_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../base"
2 |
3 | describe VagrantPlugins::ProviderVirtualBox::Driver::Version_4_3 do
4 | include_context "virtualbox"
5 |
6 | let(:vbox_version) { "4.3.0" }
7 |
8 | subject { VagrantPlugins::ProviderVirtualBox::Driver::Meta.new(uuid) }
9 |
10 | it_behaves_like "a version 4.x virtualbox driver"
11 | end
12 |
--------------------------------------------------------------------------------
/lib/vagrant/config/v1/dummy_config.rb:
--------------------------------------------------------------------------------
1 | module Vagrant
2 | module Config
3 | module V1
4 | # This is a configuration object that can have anything done
5 | # to it. Anything, and it just appears to keep working.
6 | class DummyConfig
7 | def method_missing(name, *args, &block)
8 | DummyConfig.new
9 | end
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/lib/vagrant/config/v2/dummy_config.rb:
--------------------------------------------------------------------------------
1 | module Vagrant
2 | module Config
3 | module V2
4 | # This is a configuration object that can have anything done
5 | # to it. Anything, and it just appears to keep working.
6 | class DummyConfig
7 | def method_missing(name, *args, &block)
8 | DummyConfig.new
9 | end
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/plugins/guests/dragonflybsd/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestDragonFlyBSD
5 | class Plugin < Vagrant.plugin("2")
6 | name "DragonFly BSD guest"
7 | description "DragonFly BSD guest support."
8 |
9 | guest(:dragonflybsd, :bsd) do
10 | require_relative "guest"
11 | Guest
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/provisioners/docker/cap/linux/docker_daemon_running.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module DockerProvisioner
3 | module Cap
4 | module Linux
5 | module DockerDaemonRunning
6 | def self.docker_daemon_running(machine)
7 | machine.communicate.test("test -f /var/run/docker.pid")
8 | end
9 | end
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/templates/guests/debian/network_static.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # The contents below are automatically generated by Vagrant. Do not modify.
3 | auto <%= options[:device] %>
4 | iface <%= options[:device] %> inet static
5 | address <%= options[:ip] %>
6 | netmask <%= options[:netmask] %>
7 | <% if options[:gateway] %>
8 | gateway <%= options[:gateway] %>
9 | <% end %>
10 | #VAGRANT-END
11 |
--------------------------------------------------------------------------------
/templates/guests/debian/network_static6.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # The contents below are automatically generated by Vagrant. Do not modify.
3 | auto <%= options[:device] %>
4 | iface <%= options[:device] %> inet6 static
5 | address <%= options[:ip] %>
6 | netmask <%= options[:netmask] %>
7 | <% if options[:gateway] %>
8 | gateway <%= options[:gateway] %>
9 | <% end %>
10 | #VAGRANT-END
11 |
--------------------------------------------------------------------------------
/templates/rgloader.rb:
--------------------------------------------------------------------------------
1 | # This file loads the proper rgloader/loader.rb file that comes packaged
2 | # with Vagrant so that encoded files can properly run with Vagrant.
3 |
4 | if ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"]
5 | require File.expand_path(
6 | "rgloader/loader", ENV["VAGRANT_INSTALLER_EMBEDDED_DIR"])
7 | else
8 | raise "Encoded files can't be read outside of the Vagrant installer."
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/commands/help/command.rb:
--------------------------------------------------------------------------------
1 | require 'optparse'
2 |
3 | module VagrantPlugins
4 | module CommandHelp
5 | class Command < Vagrant.plugin("2", :command)
6 | def self.synopsis
7 | "shows the help for a subcommand"
8 | end
9 |
10 | def execute
11 | return @env.cli([]) if @argv.empty?
12 | @env.cli([@argv[0], "-h"])
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/guests/darwin/cap/verify_vmware_hgfs.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestDarwin
3 | module Cap
4 | class VerifyVmwareHgfs
5 | def self.verify_vmware_hgfs(machine)
6 | kext_bundle_id = "com.vmware.kext.vmhgfs"
7 | machine.communicate.test("kextstat -b #{kext_bundle_id} -l | grep #{kext_bundle_id}")
8 | end
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/action/is_windows.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HyperV
3 | module Action
4 | class IsWindows
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | env[:result] = env[:machine].config.vm.guest == :windows
11 | @app.call(env)
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/scripts/check_hyperv.ps1:
--------------------------------------------------------------------------------
1 | # Include the following modules
2 | $Dir = Split-Path $script:MyInvocation.MyCommand.Path
3 | . ([System.IO.Path]::Combine($Dir, "utils\write_messages.ps1"))
4 |
5 | $check = $(-Not (-Not (Get-Command "Get-VMSwitch" -errorAction SilentlyContinue)))
6 | $result = @{
7 | result = $check
8 | }
9 |
10 | Write-Output-Message $(ConvertTo-Json $result)
11 |
--------------------------------------------------------------------------------
/test/config/acceptance_boxes.yml:
--------------------------------------------------------------------------------
1 | # This is the list of required boxes for acceptance tests, and
2 | # their locations. The locations are used to download the boxes
3 | # on the fly, if necessary. Additionally, a SHA1 checksum is
4 | # given to determine if the box needs to be updated.
5 | - name: default
6 | url: http://files.vagrantup.com/test/boxes/default.box
7 | checksum: 1b0a7eb6e152c5b43f45485654ff4965a7f9f604
8 |
--------------------------------------------------------------------------------
/keys/vagrant.pub:
--------------------------------------------------------------------------------
1 | ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key
2 |
--------------------------------------------------------------------------------
/plugins/kernel_v1/config/package.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module Kernel_V1
5 | class PackageConfig < Vagrant.plugin("1", :config)
6 | attr_accessor :name
7 |
8 | def initialize
9 | @name = UNSET_VALUE
10 | end
11 |
12 | def upgrade(new)
13 | new.package.name = @name if @name != UNSET_VALUE
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/providers/docker/action/is_build.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module DockerProvider
3 | module Action
4 | class IsBuild
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | env[:result] = !!env[:machine].provider_config.build_dir
11 | @app.call(env)
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/vagrant-spec.config.example.rb:
--------------------------------------------------------------------------------
1 | require_relative "test/acceptance/base"
2 |
3 | Vagrant::Spec::Acceptance.configure do |c|
4 | c.component_paths << File.expand_path("../test/acceptance", __FILE__)
5 | c.skeleton_paths << File.expand_path("../test/acceptance/skeletons", __FILE__)
6 |
7 | c.provider "virtualbox",
8 | box: "",
9 | contexts: ["provider-context/virtualbox"]
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/guests/debian/cap/rsync.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestDebian
3 | module Cap
4 | class RSync
5 | def self.rsync_install(machine)
6 | comm = machine.communicate
7 | comm.sudo <<-EOH.gsub(/^ {14}/, '')
8 | apt-get -yqq update
9 | apt-get -yqq install rsync
10 | EOH
11 | end
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/cap/public_address.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HyperV
3 | module Cap
4 | module PublicAddress
5 | def self.public_address(machine)
6 | return nil if machine.state.id != :running
7 |
8 | ssh_info = machine.ssh_info
9 | return nil if !ssh_info
10 | ssh_info[:host]
11 | end
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/pushes/ftp/locales/en.yml:
--------------------------------------------------------------------------------
1 | en:
2 | ftp_push:
3 | errors:
4 | missing_attribute: |-
5 | Missing required attribute '%{attribute}'. The Vagrant FTP Push plugin
6 | requires you set this attribute. Please set this attribute in your
7 | Vagrantfile, for example:
8 |
9 | config.push.define "ftp" do |push|
10 | push.%{attribute} = "..."
11 | end
12 |
--------------------------------------------------------------------------------
/templates/guests/funtoo/network_static.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # The contents below are automatically generated by Vagrant. Do not modify.
3 | template='interface'
4 | ipaddr='<%= options[:ip] %>/<%= options[:netmask] %>'
5 | <% [:gateway, :nameservers, :domain, :route, :gateway6, :route6, :mtu].each do |key| %>
6 | <% if options[key] %>
7 | <%= key %>='<%= options[key] %>'
8 | <% end %>
9 | <% end %>
10 | #VAGRANT-END
11 |
--------------------------------------------------------------------------------
/website/source/docs/vagrant-cloud/users/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: "vagrant-cloud"
3 | page_title: "User Accounts"
4 | sidebar_current: "vagrant-cloud-users"
5 | ---
6 |
7 | # User Accounts
8 |
9 | Users are the main identity system in Vagrant Cloud. A user can be a
10 | member of multiple [organizations](/docs/vagrant-cloud/organizations/index.html),
11 | as well as individually collaborate on various resources.
12 |
--------------------------------------------------------------------------------
/lib/vagrant/util/line_ending_helpers.rb:
--------------------------------------------------------------------------------
1 | module Vagrant
2 | module Util
3 | module LineEndingHelpers
4 | # Converts line endings to unix-style line endings in the
5 | # given string.
6 | #
7 | # @param [String] string Original string
8 | # @return [String] The fixed string
9 | def dos_to_unix(string)
10 | string.gsub("\r\n", "\n")
11 | end
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/plugins/commands/box/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandBox
5 | class Plugin < Vagrant.plugin("2")
6 | name "box command"
7 | description "The `box` command gives you a way to manage boxes."
8 |
9 | command("box") do
10 | require File.expand_path("../command/root", __FILE__)
11 | Command::Root
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/guests/suse/cap/rsync.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestSUSE
3 | module Cap
4 | class RSync
5 | def self.rsync_installed(machine)
6 | machine.communicate.test("test -f /usr/bin/rsync")
7 | end
8 |
9 | def self.rsync_install(machine)
10 | machine.communicate.sudo("zypper -n install rsync")
11 | end
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/guests/tinycore/cap/change_host_name.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestTinyCore
3 | module Cap
4 | class ChangeHostName
5 | def self.change_host_name(machine, name)
6 | if !machine.communicate.test("hostname | grep '^#{name}$'")
7 | machine.communicate.sudo("/usr/bin/sethostname #{name}")
8 | end
9 | end
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/website/source/assets/stylesheets/_community.scss:
--------------------------------------------------------------------------------
1 | #inner {
2 | .people {
3 | margin-top: 30px;
4 |
5 | .person {
6 | &:after {
7 | display: block;
8 | clear: both;
9 | content: ' ';
10 | }
11 |
12 | img {
13 | width: 125px;
14 | margin: auto auto;
15 | }
16 |
17 | .bio {
18 | padding-left: 150px;
19 | }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/website/source/layouts/inner.erb:
--------------------------------------------------------------------------------
1 | <% wrap_layout :layout do %>
2 |
3 |
4 |
7 |
8 |
9 | <%= yield %>
10 |
11 |
12 |
13 | <% end %>
14 |
--------------------------------------------------------------------------------
/lib/vagrant/util/safe_env.rb:
--------------------------------------------------------------------------------
1 | module Vagrant
2 | module Util
3 | class SafeEnv
4 | # This yields an environment hash to change and catches any issues
5 | # while changing the environment variables and raises a helpful error
6 | # to end users.
7 | def self.change_env
8 | yield ENV
9 | rescue Errno::EINVAL
10 | raise Errors::EnvInval
11 | end
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/plugins/commands/snapshot/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandSnapshot
5 | class Plugin < Vagrant.plugin("2")
6 | name "snapshot command"
7 | description "The `snapshot` command gives you a way to manage snapshots."
8 |
9 | command("snapshot") do
10 | require_relative "command/root"
11 | Command::Root
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/templates/guests/suse/network_static.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # The contents below are automatically generated by Vagrant. Do not modify.
3 | BOOTPROTO='static'
4 | IPADDR='<%= options[:ip] %>'
5 | NETMASK='<%= options[:netmask] %>'
6 | DEVICE='<%= options[:device] %>'
7 | <% if options[:gateway] -%>
8 | GATEWAY='<%= options[:gateway] %>'
9 | <% end -%>
10 | PEERDNS='no'
11 | STARTMODE='auto'
12 | USERCONTROL='no'
13 | #VAGRANT-END
14 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/cap/public_address.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Cap
4 | module PublicAddress
5 | def self.public_address(machine)
6 | return nil if machine.state.id != :running
7 |
8 | ssh_info = machine.ssh_info
9 | return nil if !ssh_info
10 | ssh_info[:host]
11 | end
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/templates/guests/gentoo/network_systemd.erb:
--------------------------------------------------------------------------------
1 | [Match]
2 | Name=<%= networks[0][:device] %>
3 |
4 | [Network]
5 | <%- gateway = nil %>
6 | <%- networks.each do |net| %>
7 | <%- if net[:type] == 'dhcp' %>
8 | DHCP=yes
9 | <%- elsif net[:ip] %>
10 | Address=<%= net[:ip] %>/<%= net[:netmask] %>
11 | <%- end %>
12 | <%- gateway ||= net[:gateway] %>
13 | <%- end %>
14 | <%- if gateway %>
15 | Gateway=<%= gateway %>
16 | <%- end %>
17 |
--------------------------------------------------------------------------------
/website/LICENSE.md:
--------------------------------------------------------------------------------
1 | # Proprietary License
2 |
3 | This license is temporary while a more official one is drafted. However,
4 | this should make it clear:
5 |
6 | The text contents of this website are MPL 2.0 licensed.
7 |
8 | The design contents of this website are proprietary and may not be reproduced
9 | or reused in any way other than to run the website locally. The license for
10 | the design is owned solely by HashiCorp, Inc.
11 |
--------------------------------------------------------------------------------
/contrib/sudoers/linux-suse:
--------------------------------------------------------------------------------
1 | Cmnd_Alias VAGRANT_CHOWN = /usr/bin/chown 0\:0 /tmp/vagrant[a-z0-9-]*
2 | Cmnd_Alias VAGRANT_MV = /usr/bin/mv -f /tmp/vagrant[a-z0-9-]* /etc/exports
3 | Cmnd_Alias VAGRANT_START = /sbin/service nfsserver start
4 | Cmnd_Alias VAGRANT_STATUS = /sbin/service nfsserver status
5 | Cmnd_Alias VAGRANT_APPLY = /usr/sbin/exportfs -ar
6 | %vagrant ALL=(root) NOPASSWD: VAGRANT_CHOWN, VAGRANT_MV, VAGRANT_START, VAGRANT_STATUS, VAGRANT_APPLY
7 |
--------------------------------------------------------------------------------
/plugins/guests/arch/cap/rsync.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestArch
3 | module Cap
4 | class RSync
5 | def self.rsync_install(machine)
6 | comm = machine.communicate
7 | comm.sudo <<-EOH.gsub(/^ {12}/, '')
8 | pacman -Sy --noconfirm
9 | pacman -S --noconfirm rsync
10 | exit $?
11 | EOH
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/guests/freebsd/cap/rsync.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../synced_folders/rsync/default_unix_cap"
2 |
3 | module VagrantPlugins
4 | module GuestFreeBSD
5 | module Cap
6 | class RSync
7 | extend VagrantPlugins::SyncedFolderRSync::DefaultUnixCap
8 |
9 | def self.rsync_install(machine)
10 | machine.communicate.sudo("pkg install -y rsync")
11 | end
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/guests/solaris/guest.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestSolaris
5 | # A general Vagrant system implementation for "solaris".
6 | #
7 | # Contributed by Blake Irvin
8 | class Guest < Vagrant.plugin("2", :guest)
9 | def detect?(machine)
10 | machine.communicate.test("uname -sr | grep SunOS | grep -v 5.11")
11 | end
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/plugins/guests/solaris11/guest.rb:
--------------------------------------------------------------------------------
1 | # A general Vagrant system implementation for "solaris 11".
2 | #
3 | # Contributed by Jan Thomas Moldung
4 |
5 | require "vagrant"
6 |
7 | module VagrantPlugins
8 | module GuestSolaris11
9 | class Guest < Vagrant.plugin("2", :guest)
10 | def detect?(machine)
11 | machine.communicate.test("uname -sr | grep 'SunOS 5.11'")
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/action/delete_vm.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HyperV
3 | module Action
4 | class DeleteVM
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | env[:ui].info("Deleting the machine...")
11 | env[:machine].provider.driver.delete_vm
12 | @app.call(env)
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/test/vagrant-spec/configs/vagrant-spec.config.virtualbox.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../acceptance/base"
2 |
3 | Vagrant::Spec::Acceptance.configure do |c|
4 | c.component_paths << File.expand_path("../test/acceptance", __FILE__)
5 | c.skeleton_paths << File.expand_path("../test/acceptance/skeletons", __FILE__)
6 |
7 | c.provider "virtualbox",
8 | box: ENV["VAGRANT_SPEC_BOX"],
9 | contexts: ["provider-context/virtualbox"]
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/commands/cap/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandCap
5 | class Plugin < Vagrant.plugin("2")
6 | name "cap command"
7 | description <<-DESC
8 | The `cap` command checks and executes arbitrary capabilities.
9 | DESC
10 |
11 | command("cap", primary: false) do
12 | require_relative "command"
13 | Command
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/commands/help/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandHelp
5 | class Plugin < Vagrant.plugin("2")
6 | name "help command"
7 | description <<-DESC
8 | The `help` command shows help for the given command.
9 | DESC
10 |
11 | command("help") do
12 | require File.expand_path("../command", __FILE__)
13 | Command
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/commands/push/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandPush
5 | class Plugin < Vagrant.plugin("2")
6 | name "push command"
7 | description <<-DESC
8 | The `push` command deploys code in this environment.
9 | DESC
10 |
11 | command("push") do
12 | require File.expand_path("../command", __FILE__)
13 | Command
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/guests/esxi/cap/change_host_name.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestEsxi
3 | module Cap
4 | class ChangeHostName
5 | def self.change_host_name(machine, name)
6 | if !machine.communicate.test("localcli system hostname get | grep '#{name}'")
7 | machine.communicate.execute("localcli system hostname set -H '#{name}'")
8 | end
9 | end
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/plugins/guests/smartos/config.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestSmartos
3 | class Config < Vagrant.plugin("2", :config)
4 | # This sets the command to use to execute items as a superuser.
5 | # @default sudo
6 | attr_accessor :suexec_cmd
7 | attr_accessor :device
8 |
9 | def initialize
10 | @suexec_cmd = 'pfexec'
11 | @device = "e1000g"
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/action/stop_instance.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HyperV
3 | module Action
4 | class StopInstance
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | env[:ui].info("Stopping the machine...")
11 | env[:machine].provider.driver.stop
12 | @app.call(env)
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/scripts/has_vmcx_support.ps1:
--------------------------------------------------------------------------------
1 | # Include the following modules
2 | $Dir = Split-Path $script:MyInvocation.MyCommand.Path
3 | . ([System.IO.Path]::Combine($Dir, "utils\write_messages.ps1"))
4 |
5 | # Windows version 10 and up have support for binary format
6 | $check = [System.Environment]::OSVersion.Version.Major -ge 10
7 | $result = @{
8 | result = $check
9 | }
10 |
11 | Write-Output-Message $(ConvertTo-Json $result)
12 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/message_not_created.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Action
4 | class MessageNotCreated
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | env[:ui].info I18n.t("vagrant.commands.common.vm_not_created")
11 | @app.call(env)
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/message_not_running.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Action
4 | class MessageNotRunning
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | env[:ui].info I18n.t("vagrant.commands.common.vm_not_running")
11 | @app.call(env)
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/provisioners/cfengine/cap/linux/cfengine_installed.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module CFEngine
3 | module Cap
4 | module Linux
5 | module CFEngineInstalled
6 | def self.cfengine_installed(machine)
7 | machine.communicate.test(
8 | "test -d /var/cfengine && test -x /var/cfengine/bin/cf-agent", sudo: true)
9 | end
10 | end
11 | end
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/test/unit/plugins/kernel_v2/config/package_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../../../../base", __FILE__)
2 |
3 | require Vagrant.source_root.join("plugins/kernel_v2/config/package")
4 |
5 | describe VagrantPlugins::Kernel_V2::PackageConfig do
6 | subject { described_class.new }
7 |
8 | describe "#name" do
9 | it "defaults to nil" do
10 | subject.finalize!
11 | expect(subject.name).to be_nil
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/plugins/commands/up/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandUp
5 | class Plugin < Vagrant.plugin("2")
6 | name "up command"
7 | description <<-DESC
8 | The `up` command brings the virtual environment up and running.
9 | DESC
10 |
11 | command("up") do
12 | require File.expand_path("../command", __FILE__)
13 | Command
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/guests/debian/cap/nfs.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestDebian
3 | module Cap
4 | class NFS
5 | def self.nfs_client_install(machine)
6 | comm = machine.communicate
7 | comm.sudo <<-EOH.gsub(/^ {12}/, '')
8 | apt-get -yqq update
9 | apt-get -yqq install nfs-common portmap
10 | exit $?
11 | EOH
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/guests/suse/cap/nfs_client.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestSUSE
3 | module Cap
4 | class NFSClient
5 | def self.nfs_client_install(machine)
6 | machine.communicate.sudo <<-EOH.gsub(/^ {12}/, '')
7 | zypper -n install nfs-client
8 | /sbin/service rpcbind restart
9 | /sbin/service nfs restart
10 | EOH
11 | end
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/action/start_instance.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HyperV
3 | module Action
4 | class StartInstance
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | env[:ui].output('Starting the machine...')
11 | env[:machine].provider.driver.start
12 | @app.call(env)
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/templates/guests/redhat/network_static6.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # The contents below are automatically generated by Vagrant. Do not modify.
3 | NM_CONTROLLED=<%= options.fetch(:nm_controlled, "no") %>
4 | BOOTPROTO=static
5 | ONBOOT=yes
6 | DEVICE=<%= options[:device] %>
7 | IPV6INIT=yes
8 | IPV6ADDR=<%= options[:ip] %>/<%= options[:netmask] %>
9 | <% if options[:gateway] -%>
10 | IPV6_DEFAULTGW=<%= options[:gateway] %>
11 | <% end %>
12 | #VAGRANT-END
13 |
--------------------------------------------------------------------------------
/contrib/emacs/vagrant.el:
--------------------------------------------------------------------------------
1 | ;;--------------------------------------------------------------------
2 | ;; Teach emacs to syntax highlight Vagrantfile as Ruby.
3 | ;;
4 | ;; Installation: Copy the line below into your emacs configuration,
5 | ;; or drop this file anywhere in your "~/.emacs.d" directory and be
6 | ;; sure to "load" it.
7 | ;;--------------------------------------------------------------------
8 | (add-to-list 'auto-mode-alist '("Vagrantfile$" . ruby-mode))
9 |
--------------------------------------------------------------------------------
/plugins/commands/powershell/scripts/reset_trustedhosts.ps1:
--------------------------------------------------------------------------------
1 | Param(
2 | [string]$hostname
3 | )
4 |
5 | $trustedHosts = (
6 | Get-Item "wsman:\localhost\client\trustedhosts").Value.Replace(
7 | $hostname, '')
8 | $trustedHosts = $trustedHosts.Replace(",,","")
9 | if($trustedHosts.EndsWith(",")){
10 | $trustedHosts = $trustedHosts.Substring(0,$trustedHosts.length-1)
11 | }
12 | Set-Item "wsman:\localhost\client\trustedhosts" -Value $trustedHosts -Force
--------------------------------------------------------------------------------
/plugins/commands/resume/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandResume
5 | class Plugin < Vagrant.plugin("2")
6 | name "resume command"
7 | description <<-DESC
8 | The `resume` command resumes a suspend virtual machine.
9 | DESC
10 |
11 | command("resume") do
12 | require File.expand_path("../command", __FILE__)
13 | Command
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/action/resume_vm.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HyperV
3 | module Action
4 | class ResumeVM
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | env[:ui].info("Resuming the machine...")
11 | env[:machine].provider.driver.resume
12 | @app.call(env)
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/message_already_running.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Action
4 | class MessageAlreadyRunning
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | env[:ui].info I18n.t("vagrant.commands.common.vm_already_running")
11 | @app.call(env)
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/lib/vagrant/util/shell_quote.rb:
--------------------------------------------------------------------------------
1 | module Vagrant
2 | module Util
3 | module ShellQuote
4 | # This will auto-escape the text with the given quote mark type.
5 | #
6 | # @param [String] text Text to escape
7 | # @param [String] quote The quote character, such as "
8 | def self.escape(text, quote)
9 | text.gsub(/#{quote}/) do |m|
10 | "#{m}\\#{m}#{m}"
11 | end
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/commands/ssh/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandSSH
5 | class Plugin < Vagrant.plugin("2")
6 | name "ssh command"
7 | description <<-DESC
8 | The `ssh` command allows you to SSH in to your running virtual machine.
9 | DESC
10 |
11 | command("ssh") do
12 | require File.expand_path("../command", __FILE__)
13 | Command
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/commands/validate/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandValidate
5 | class Plugin < Vagrant.plugin("2")
6 | name "validate command"
7 | description <<-DESC
8 | The `validate` command validates the Vagrantfile.
9 | DESC
10 |
11 | command("validate") do
12 | require File.expand_path("../command", __FILE__)
13 | Command
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/guests/amazon/cap/flavor.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestAmazon
3 | module Cap
4 | class Flavor
5 | def self.flavor(machine)
6 | # Amazon AMI is a frankenstien RHEL, mainly based on 6
7 | # Maybe in the future if they incoporate RHEL 7 elements
8 | # this should be extended to read /etc/os-release or similar
9 | return :rhel
10 | end
11 | end
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/plugins/kernel_v2/config/package.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module Kernel_V2
5 | class PackageConfig < Vagrant.plugin("2", :config)
6 | attr_accessor :name
7 |
8 | def initialize
9 | @name = UNSET_VALUE
10 | end
11 |
12 | def finalize!
13 | @name = nil if @name == UNSET_VALUE
14 | end
15 |
16 | def to_s
17 | "Package"
18 | end
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/action/suspend_vm.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HyperV
3 | module Action
4 | class SuspendVM
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | env[:ui].info("Suspending the machine...")
11 | env[:machine].provider.driver.suspend
12 | @app.call(env)
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/scripts/export_vm.ps1:
--------------------------------------------------------------------------------
1 | Param(
2 | [Parameter(Mandatory=$true)]
3 | [string]$VmId,
4 | [Parameter(Mandatory=$true)]
5 | [string]$Path
6 | )
7 |
8 | $vm = Get-VM -Id $VmId -ErrorAction "Stop"
9 | $vm | Export-VM -Path $Path
10 |
11 | # Prepare directory structure for box import
12 | $name = $vm.Name
13 | Move-Item $Path/$name/* $Path
14 | Remove-Item -Path $Path/Snapshots -Force -Recurse
15 | Remove-Item -Path $Path/$name -Force
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/driver/version_5_1.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../version_5_0", __FILE__)
2 |
3 | module VagrantPlugins
4 | module ProviderVirtualBox
5 | module Driver
6 | # Driver for VirtualBox 5.1.x
7 | class Version_5_1 < Version_5_0
8 | def initialize(uuid)
9 | super
10 |
11 | @logger = Log4r::Logger.new("vagrant::provider::virtualbox_5_1")
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/driver/version_5_2.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../version_5_1", __FILE__)
2 |
3 | module VagrantPlugins
4 | module ProviderVirtualBox
5 | module Driver
6 | # Driver for VirtualBox 5.2.x
7 | class Version_5_2 < Version_5_1
8 | def initialize(uuid)
9 | super
10 |
11 | @logger = Log4r::Logger.new("vagrant::provider::virtualbox_5_2")
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/guests/redhat/cap/rsync.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestRedHat
3 | module Cap
4 | class RSync
5 | def self.rsync_install(machine)
6 | machine.communicate.sudo <<-EOH.gsub(/^ {12}/, '')
7 | if command -v dnf; then
8 | dnf -y install rsync
9 | else
10 | yum -y install rsync
11 | fi
12 | EOH
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/provisioners/ansible/constants.rb:
--------------------------------------------------------------------------------
1 |
2 | module VagrantPlugins
3 | module Ansible
4 | COMPATIBILITY_MODE_AUTO = "auto".freeze
5 | COMPATIBILITY_MODE_V1_8 = "1.8".freeze
6 | COMPATIBILITY_MODE_V2_0 = "2.0".freeze
7 | SAFE_COMPATIBILITY_MODE = COMPATIBILITY_MODE_V1_8
8 | COMPATIBILITY_MODES = [
9 | COMPATIBILITY_MODE_AUTO,
10 | COMPATIBILITY_MODE_V1_8,
11 | COMPATIBILITY_MODE_V2_0,
12 | ].freeze
13 | end
14 | end
--------------------------------------------------------------------------------
/test/vagrant-spec/scripts/centos-setup.virtualbox.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -xe
3 |
4 | curl -Lo /etc/yum.repos.d/virtualbox.repo http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
5 | yum groupinstall -y "Development Tools"
6 | yum install -y kernel-devel
7 | yum install -y VirtualBox-${VAGRANT_CENTOS_VIRTUALBOX_VERSION:-5.1}
8 |
9 | pushd /vagrant
10 |
11 | rpm -ivh ./pkg/dist/vagrant_*_x86_64.rpm
12 | vagrant plugin install ./vagrant-spec.gem
13 |
14 | popd
15 |
--------------------------------------------------------------------------------
/plugins/guests/esxi/cap/halt.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestEsxi
3 | module Cap
4 | class Halt
5 | def self.halt(machine)
6 | begin
7 | machine.communicate.execute("/bin/halt -d 0")
8 | rescue IOError, Vagrant::Errors::SSHDisconnected
9 | # Ignore, this probably means connection closed because it
10 | # shut down.
11 | end
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/guests/freebsd/guest.rb:
--------------------------------------------------------------------------------
1 | require 'vagrant/util/template_renderer'
2 |
3 | module VagrantPlugins
4 | module GuestFreeBSD
5 | # A general Vagrant system implementation for "freebsd".
6 | #
7 | # Contributed by Kenneth Vestergaard
8 | class Guest < Vagrant.plugin("2", :guest)
9 | def detect?(machine)
10 | machine.communicate.test("uname -s | grep 'FreeBSD'", {shell: "sh"})
11 | end
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/test/unit/vagrant/util/line_endings_helper_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../../../base", __FILE__)
2 |
3 | require "vagrant/util/line_ending_helpers"
4 |
5 | describe Vagrant::Util::LineEndingHelpers do
6 | let(:klass) do
7 | Class.new do
8 | extend Vagrant::Util::LineEndingHelpers
9 | end
10 | end
11 |
12 | it "should convert DOS to unix-style line endings" do
13 | expect(klass.dos_to_unix("foo\r\nbar\r\n")).to eq("foo\nbar\n")
14 | end
15 | end
16 |
17 |
--------------------------------------------------------------------------------
/website/source/docs/vagrant-cloud/users/recovery.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: "vagrant-cloud"
3 | page_title: "Account Recovery"
4 | sidebar_current: "vagrant-cloud-users-recovery"
5 | ---
6 |
7 | # Account Recovery
8 |
9 | If you have lost access to your Vagrant Cloud account, use the reset
10 | password form on the login page to send yourself a link to reset your password.
11 |
12 | If an email is unknown, [contact us](mailto:support+vagrantcloud@hashicorp.com)
13 | for further help.
14 |
--------------------------------------------------------------------------------
/lib/vagrant/plugin/v1/errors.rb:
--------------------------------------------------------------------------------
1 | # This file contains all the errors that the V1 plugin interface
2 | # may throw.
3 |
4 | module Vagrant
5 | module Plugin
6 | module V1
7 | # Exceptions that can be thrown within the plugin interface all
8 | # inherit from this parent exception.
9 | class Error < StandardError; end
10 |
11 | # This is thrown when a command name given is invalid.
12 | class InvalidCommandName < Error; end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/lib/vagrant/plugin/v2/errors.rb:
--------------------------------------------------------------------------------
1 | # This file contains all the errors that the V2 plugin interface
2 | # may throw.
3 |
4 | module Vagrant
5 | module Plugin
6 | module V2
7 | # Exceptions that can be thrown within the plugin interface all
8 | # inherit from this parent exception.
9 | class Error < StandardError; end
10 |
11 | # This is thrown when a command name given is invalid.
12 | class InvalidCommandName < Error; end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/test/unit/vagrant/util/ansi_escape_code_remover_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../../../base", __FILE__)
2 |
3 | require "vagrant/util/ansi_escape_code_remover"
4 |
5 | describe Vagrant::Util::ANSIEscapeCodeRemover do
6 | let(:klass) do
7 | Class.new do
8 | extend Vagrant::Util::ANSIEscapeCodeRemover
9 | end
10 | end
11 |
12 | it "should remove ANSI escape codes" do
13 | expect(klass.remove_ansi_escape_codes("\e[Hyo")).to eq("yo")
14 | end
15 | end
16 |
17 |
--------------------------------------------------------------------------------
/website/source/docs/other/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: "docs"
3 | page_title: "Other"
4 | sidebar_current: "other"
5 | description: |-
6 | This page covers Vagrant information that does not quite fit under the other
7 | categories.
8 | ---
9 |
10 | # Other
11 |
12 | This section covers other information that does not quite fit under the
13 | other categories.
14 |
15 | - [Debugging](/docs/other/debugging.html)
16 | - [Environment Variables](/docs/other/environmental-variables.html)
17 |
--------------------------------------------------------------------------------
/plugins/commands/init/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandInit
5 | class Plugin < Vagrant.plugin("2")
6 | name "init command"
7 | description <<-DESC
8 | The `init` command sets up your working directory to be a
9 | Vagrant-managed environment.
10 | DESC
11 |
12 | command("init") do
13 | require File.expand_path("../command", __FILE__)
14 | Command
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/guests/windows/scripts/winrs_v3_get_adapters.ps1:
--------------------------------------------------------------------------------
1 | $adapters = get-ciminstance win32_networkadapter -filter "macaddress is not null"
2 | $processed = @()
3 | foreach ($adapter in $adapters) {
4 | $Processed += new-object PSObject -Property @{
5 | mac_address = $adapter.macaddress
6 | net_connection_id = $adapter.netconnectionid
7 | interface_index = $adapter.interfaceindex
8 | index = $adapter.index
9 | }
10 | }
11 | convertto-json -inputobject $processed
12 |
--------------------------------------------------------------------------------
/plugins/guests/debian/cap/smb.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestDebian
3 | module Cap
4 | class SMB
5 | def self.smb_install(machine)
6 | comm = machine.communicate
7 | if !comm.test("test -f /sbin/mount.cifs")
8 | comm.sudo <<-EOH.gsub(/^ {14}/, '')
9 | apt-get -yqq update
10 | apt-get -yqq install cifs-utils
11 | EOH
12 | end
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/lib/vagrant/action/builtin/handle_box_url.rb:
--------------------------------------------------------------------------------
1 | module Vagrant
2 | module Action
3 | module Builtin
4 | class HandleBoxUrl < HandleBox
5 | def call(env)
6 | env[:ui].warn("HandleBoxUrl middleware is deprecated. Use HandleBox instead.")
7 | env[:ui].warn("This is a bug with the provider. Please contact the creator")
8 | env[:ui].warn("of the provider you use to fix this.")
9 | super
10 | end
11 | end
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/plugins/commands/halt/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandHalt
5 | class Plugin < Vagrant.plugin("2")
6 | name "halt command"
7 | description <<-DESC
8 | The `halt` command shuts your virtual machine down forcefully.
9 | The command `up` recreates it.
10 | DESC
11 |
12 | command("halt") do
13 | require File.expand_path("../command", __FILE__)
14 | Command
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/guests/arch/cap/smb.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestArch
3 | module Cap
4 | class SMB
5 | def self.smb_install(machine)
6 | comm = machine.communicate
7 | if !comm.test("test -f /usr/bin/mount.cifs")
8 | comm.sudo <<-EOH.gsub(/^ {14}/, '')
9 | pacman -Sy --noconfirm
10 | pacman -S --noconfirm cifs-utils
11 | EOH
12 | end
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/guests/darwin/guest.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestDarwin
5 | # A general Vagrant system implementation for OS X (ie. "Darwin").
6 | #
7 | # Contributed by: - Brian Johnson
8 | # - Tim Sutton
9 | class Guest < Vagrant.plugin("2", :guest)
10 | def detect?(machine)
11 | machine.communicate.test("uname -s | grep 'Darwin'")
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/guests/fedora/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestFedora
5 | class Plugin < Vagrant.plugin("2")
6 | name "Fedora guest"
7 | description "Fedora guest support."
8 |
9 | guest(:fedora, :redhat) do
10 | require_relative "guest"
11 | Guest
12 | end
13 |
14 | guest_capability(:fedora, :flavor) do
15 | require_relative "cap/flavor"
16 | Cap::Flavor
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/guests/linux/cap/halt.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestLinux
3 | module Cap
4 | class Halt
5 | def self.halt(machine)
6 | begin
7 | machine.communicate.sudo("shutdown -h now")
8 | rescue IOError, Vagrant::Errors::SSHDisconnected
9 | # Do nothing, because it probably means the machine shut down
10 | # and SSH connection was lost.
11 | end
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/guests/tinycore/cap/halt.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestTinyCore
3 | module Cap
4 | class Halt
5 | def self.halt(machine)
6 | begin
7 | machine.communicate.sudo("poweroff")
8 | rescue IOError, Vagrant::Errors::SSHDisconnected
9 | # Do nothing, because it probably means the machine shut down
10 | # and SSH connection was lost.
11 | end
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/action/message_will_not_destroy.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HyperV
3 | module Action
4 | class MessageWillNotDestroy
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | env[:ui].info I18n.t("vagrant.commands.destroy.will_not_destroy",
11 | name: env[:machine].name)
12 | @app.call(env)
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/templates/guests/nixos/network.erb:
--------------------------------------------------------------------------------
1 | { config, pkgs, ... }:
2 | {
3 | networking.interfaces = [
4 | <% networks.select {|n| n[:device]}.each do |network| %>
5 | {
6 | name = "<%= network[:device] %>";
7 | <% if network[:type] == :static %>
8 | ipAddress = "<%= network[:ip] %>";
9 | <% end %>
10 | <% if network[:prefix_length] %>
11 | prefixLength = <%= network[:prefix_length] %>;
12 | <% end %>
13 | }
14 | <% end %>
15 | ];
16 | }
17 |
--------------------------------------------------------------------------------
/test/unit/support/shared/action_synced_folders_context.rb:
--------------------------------------------------------------------------------
1 | shared_context "synced folder actions" do
2 | # This creates a synced folder implementation.
3 | def impl(usable, name)
4 | Class.new(Vagrant.plugin("2", :synced_folder)) do
5 | define_method(:name) do
6 | name
7 | end
8 |
9 | define_method(:usable?) do |machine, raise_error=false|
10 | raise "#{name}: usable" if raise_error && !usable
11 | usable
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/keys/README.md:
--------------------------------------------------------------------------------
1 | # Insecure Keypair
2 |
3 | These keys are the "insecure" public/private keypair we offer to
4 | [base box creators](https://www.vagrantup.com/docs/boxes/base.html) for use in their base boxes so that
5 | vagrant installations can automatically SSH into the boxes.
6 |
7 | If you're working with a team or company or with a custom box and
8 | you want more secure SSH, you should create your own keypair
9 | and configure the private key in the Vagrantfile with
10 | `config.ssh.private_key_path`
11 |
--------------------------------------------------------------------------------
/plugins/guests/suse/cap/halt.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestSUSE
3 | module Cap
4 | class Halt
5 | def self.halt(machine)
6 | begin
7 | machine.communicate.sudo("/sbin/shutdown -h now")
8 | rescue IOError, Vagrant::Errors::SSHDisconnected
9 | # Do nothing, because it probably means the machine shut down
10 | # and SSH connection was lost.
11 | end
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/hosts/suse/cap/nfs.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HostSUSE
3 | module Cap
4 | class NFS
5 | def self.nfs_installed(env)
6 | system("rpm -q nfs-kernel-server > /dev/null 2>&1")
7 | end
8 |
9 | def self.nfs_check_command(env)
10 | "/sbin/service nfsserver status"
11 | end
12 |
13 | def self.nfs_start_command(env)
14 | "/sbin/service nfsserver start"
15 | end
16 | end
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/plugins/kernel_v2/config/vagrant.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module Kernel_V2
5 | class VagrantConfig < Vagrant.plugin("2", :config)
6 | attr_accessor :host
7 |
8 | def initialize
9 | @host = UNSET_VALUE
10 | end
11 |
12 | def finalize!
13 | @host = :detect if @host == UNSET_VALUE
14 | @host = @host.to_sym if @host
15 | end
16 |
17 | def to_s
18 | "Vagrant"
19 | end
20 | end
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/plugins/providers/docker/action/has_ssh.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module DockerProvider
3 | module Action
4 | # This middleware is used with Call to test if this machine supports
5 | # SSH.
6 | class HasSSH
7 | def initialize(app, env)
8 | @app = app
9 | end
10 |
11 | def call(env)
12 | env[:result] = env[:machine].provider_config.has_ssh
13 | @app.call(env)
14 | end
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/providers/docker/action/host_machine_required.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module DockerProvider
3 | module Action
4 | # This middleware is used with Call to test if we're using a host VM.
5 | class HostMachineRequired
6 | def initialize(app, env)
7 | @app = app
8 | end
9 |
10 | def call(env)
11 | env[:result] = env[:machine].provider.host_vm?
12 | @app.call(env)
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/test/unit/plugins/communicators/winrm/config_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../../../../base", __FILE__)
2 |
3 | require Vagrant.source_root.join("plugins/communicators/winrm/config")
4 |
5 | describe VagrantPlugins::CommunicatorWinRM::Config do
6 | let(:machine) { double("machine") }
7 |
8 | subject { described_class.new }
9 |
10 | it "is valid by default" do
11 | subject.finalize!
12 | result = subject.validate(machine)
13 | expect(result["WinRM"]).to be_empty
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/website/source/docs/cli/validate.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: "docs"
3 | page_title: "vagrant validate - Command-Line Interface"
4 | sidebar_current: "cli-validate"
5 | description: |-
6 | The "vagrant validate" command is used to validate your Vagrantfile.
7 | ---
8 |
9 | # Validate
10 |
11 | **Command: `vagrant validate`**
12 |
13 | This command validates your [Vagrantfile](/docs/vagrantfile/).
14 |
15 | ## Examples
16 |
17 | ```sh
18 | $ vagrant validate
19 | Vagrantfile validated successfully.
20 | ```
21 |
--------------------------------------------------------------------------------
/plugins/commands/rdp/errors.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module CommandRDP
3 | module Errors
4 | # A convenient superclass for all our errors.
5 | class RDPError < Vagrant::Errors::VagrantError
6 | error_namespace("vagrant_rdp.errors")
7 | end
8 |
9 | class HostUnsupported < RDPError
10 | error_key(:host_unsupported)
11 | end
12 |
13 | class RDPUndetected < RDPError
14 | error_key(:rdp_undetected)
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/scripts/get_switches.ps1:
--------------------------------------------------------------------------------
1 | # This will have a SwitchType property. As far as I know the values are:
2 | #
3 | # 0 - Private
4 | # 1 - Internal
5 | #
6 | # Include the following modules
7 | $Dir = Split-Path $script:MyInvocation.MyCommand.Path
8 | . ([System.IO.Path]::Combine($Dir, "utils\write_messages.ps1"))
9 |
10 | $Switches = @(Get-VMSwitch `
11 | | Select-Object Name,SwitchType,NetAdapterInterfaceDescription)
12 | Write-Output-Message $(ConvertTo-JSON $Switches)
13 |
--------------------------------------------------------------------------------
/plugins/commands/provider/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandProvider
5 | class Plugin < Vagrant.plugin("2")
6 | name "provider command"
7 | description <<-DESC
8 | The `provider` command is used to interact with the various providers
9 | that are installed with Vagrant.
10 | DESC
11 |
12 | command("provider", primary: false) do
13 | require_relative "command"
14 | Command
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/commands/reload/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandReload
5 | class Plugin < Vagrant.plugin("2")
6 | name "reload command"
7 | description <<-DESC
8 | The `reload` command will halt, reconfigure your machine based on
9 | the Vagrantfile, and bring it back up.
10 | DESC
11 |
12 | command("reload") do
13 | require File.expand_path("../command", __FILE__)
14 | Command
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/guests/amazon/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestAmazon
5 | class Plugin < Vagrant.plugin("2")
6 | name "Amazon Linux guest"
7 | description "Amazon linux guest support."
8 |
9 | guest(:amazon, :redhat) do
10 | require_relative "guest"
11 | Guest
12 | end
13 |
14 | guest_capability(:amazon, :flavor) do
15 | require_relative "cap/flavor"
16 | Cap::Flavor
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/guests/bsd/cap/halt.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestBSD
3 | module Cap
4 | class Halt
5 | def self.halt(machine)
6 | begin
7 | machine.communicate.sudo("/sbin/shutdown -p now", shell: "sh")
8 | rescue IOError, Vagrant::Errors::SSHDisconnected
9 | # Do nothing, because it probably means the machine shut down
10 | # and SSH connection was lost.
11 | end
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/guests/haiku/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestHaiku
5 | class Plugin < Vagrant.plugin("2")
6 | name "Haiku guest"
7 | description "Haiku guest support."
8 |
9 | guest(:haiku) do
10 | require_relative "guest"
11 | Guest
12 | end
13 |
14 | guest_capability(:haiku, :change_host_name) do
15 | require_relative "cap/change_host_name"
16 | Cap::ChangeHostName
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/destroy.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Action
4 | class Destroy
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | env[:ui].info I18n.t("vagrant.actions.vm.destroy.destroying")
11 | env[:machine].provider.driver.delete
12 | env[:machine].id = nil
13 |
14 | @app.call(env)
15 | end
16 | end
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/message_will_not_destroy.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Action
4 | class MessageWillNotDestroy
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | env[:ui].info I18n.t("vagrant.commands.destroy.will_not_destroy",
11 | name: env[:machine].name)
12 | @app.call(env)
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/commands/package/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandPackage
5 | class Plugin < Vagrant.plugin("2")
6 | name "package command"
7 | description <<-DESC
8 | The `package` command will take a previously existing Vagrant
9 | environment and package it into a box file.
10 | DESC
11 |
12 | command("package") do
13 | require File.expand_path("../command", __FILE__)
14 | Command
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/commands/version/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandVersion
5 | class Plugin < Vagrant.plugin("2")
6 | name "version command"
7 | description <<-DESC
8 | The `version` command prints the currently installed version
9 | as well as the latest available version.
10 | DESC
11 |
12 | command("version") do
13 | require File.expand_path("../command", __FILE__)
14 | Command
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/action/package.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../../lib/vagrant/action/general/package"
2 |
3 | module VagrantPlugins
4 | module HyperV
5 | module Action
6 | class Package < Vagrant::Action::General::Package
7 | # Doing this so that we can test that the parent is properly
8 | # called in the unit tests.
9 | alias_method :general_call, :call
10 | def call(env)
11 | general_call(env)
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/prepare_nfs_valid_ids.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Action
4 | class PrepareNFSValidIds
5 | def initialize(app, env)
6 | @app = app
7 | @logger = Log4r::Logger.new("vagrant::action::vm::nfs")
8 | end
9 |
10 | def call(env)
11 | env[:nfs_valid_ids] = env[:machine].provider.driver.read_vms.values
12 | @app.call(env)
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/website/source/docs/providers/custom.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: "docs"
3 | page_title: "Custom Provider - Providers"
4 | sidebar_current: "providers-custom"
5 | description: |-
6 | To learn how to make your own custom Vagrant providers, read the Vagrant
7 | plugin development guide on creating custom providers.
8 | ---
9 |
10 | # Custom Provider
11 |
12 | To learn how to make your own custom Vagrant providers, read the Vagrant plugin
13 | development guide on [creating custom providers](/docs/plugins/providers.html).
14 |
--------------------------------------------------------------------------------
/lib/vagrant/host.rb:
--------------------------------------------------------------------------------
1 | require "vagrant/capability_host"
2 |
3 | module Vagrant
4 | # This class handles host-OS specific interations. It is responsible for
5 | # detecting the proper host OS implementation and delegating capabilities
6 | # to plugins.
7 | #
8 | # See {Guest} for more information on capabilities.
9 | class Host
10 | include CapabilityHost
11 |
12 | def initialize(host, hosts, capabilities, env)
13 | initialize_capabilities!(host, hosts, capabilities, env)
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/commands/provision/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandProvision
5 | class Plugin < Vagrant.plugin("2")
6 | name "provision command"
7 | description <<-DESC
8 | The `provision` command provisions your virtual machine based on the
9 | configuration of the Vagrantfile.
10 | DESC
11 |
12 | command("provision") do
13 | require File.expand_path("../command", __FILE__)
14 | Command
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/communicators/winrm/command_filters/chmod.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module CommunicatorWinRM
3 | module CommandFilters
4 | # Converts a *nix 'chmod' command to a PowerShell equivalent (none)
5 | class Chmod
6 | def filter(command)
7 | # Not supported on Windows, the communicator should skip this command
8 | ''
9 | end
10 |
11 | def accept?(command)
12 | command.start_with?('chmod ')
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/communicators/winrm/command_filters/chown.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module CommunicatorWinRM
3 | module CommandFilters
4 | # Converts a *nix 'chown' command to a PowerShell equivalent (none)
5 | class Chown
6 | def filter(command)
7 | # Not supported on Windows, the communicator should skip this command
8 | ''
9 | end
10 |
11 | def accept?(command)
12 | command.start_with?('chown ')
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/guests/linux/cap/choose_addressable_ip_addr.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestLinux
3 | module Cap
4 | module ChooseAddressableIPAddr
5 | def self.choose_addressable_ip_addr(machine, possible)
6 | comm = machine.communicate
7 |
8 | possible.each do |ip|
9 | if comm.test("ping -c1 -w1 -W1 #{ip}")
10 | return ip
11 | end
12 | end
13 |
14 | return nil
15 | end
16 | end
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/plugins/provisioners/docker/cap/redhat/docker_start_service.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module DockerProvisioner
3 | module Cap
4 | module Redhat
5 | module DockerStartService
6 | def self.docker_start_service(machine)
7 | machine.communicate.sudo("service docker start")
8 | # TODO :: waiting to start
9 | sleep 5
10 | machine.communicate.sudo("chkconfig docker on")
11 | end
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/test/unit/plugins/guests/amazon/cap/flavor_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../../base"
2 |
3 | describe "VagrantPlugins::GuestAmazon::Cap::Flavor" do
4 | let(:caps) do
5 | VagrantPlugins::GuestAmazon::Plugin
6 | .components
7 | .guest_capabilities[:amazon]
8 | end
9 |
10 | let(:machine) { double("machine") }
11 |
12 | describe ".flavor" do
13 | let(:cap) { caps.get(:flavor) }
14 |
15 | it "returns rhel" do
16 | expect(cap.flavor(machine)).to be(:rhel)
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/plugins/commands/list-commands/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandListCommands
5 | class Plugin < Vagrant.plugin("2")
6 | name "list-commands command"
7 | description <<-DESC
8 | The `list-commands` command will list all commands that Vagrant
9 | understands, even hidden ones.
10 | DESC
11 |
12 | command("list-commands", primary: false) do
13 | require_relative "command"
14 | Command
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/commands/suspend/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandSuspend
5 | class Plugin < Vagrant.plugin("2")
6 | name "suspend command"
7 | description <<-DESC
8 | The `suspend` command suspends execution and puts it to sleep.
9 | The command `resume` returns it to running status.
10 | DESC
11 |
12 | command("suspend") do
13 | require File.expand_path("../command", __FILE__)
14 | Command
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/provisioners/chef/cap/windows/chef_install.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../omnibus"
2 |
3 | module VagrantPlugins
4 | module Chef
5 | module Cap
6 | module Windows
7 | module ChefInstall
8 | def self.chef_install(machine, project, version, channel, omnibus_url, options = {})
9 | command = Omnibus.ps_command(project, version, channel, omnibus_url, options)
10 | machine.communicate.sudo(command)
11 | end
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/pushes/noop/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module NoopDeploy
5 | class Plugin < Vagrant.plugin("2")
6 | name "noop"
7 | description <<-DESC
8 | Literally do nothing
9 | DESC
10 |
11 | config(:noop, :push) do
12 | require File.expand_path("../config", __FILE__)
13 | Config
14 | end
15 |
16 | push(:noop) do
17 | require File.expand_path("../push", __FILE__)
18 | Push
19 | end
20 | end
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/test/unit/plugins/synced_folders/nfs/config_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../../../../base", __FILE__)
2 |
3 | require Vagrant.source_root.join("plugins/synced_folders/nfs/config")
4 |
5 | describe VagrantPlugins::SyncedFolderNFS::Config do
6 | subject { described_class.new }
7 |
8 | context "defaults" do
9 | before do
10 | subject.finalize!
11 | end
12 |
13 | its(:functional) { should be(true) }
14 | its(:map_gid) { should eq(:auto) }
15 | its(:map_uid) { should eq(:auto) }
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/website/source/android-manifest.json.erb:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Vagrant by HashiCorp",
3 | "icons": [
4 | {
5 | "src": "<%= image_path('favicons/android-chrome-192x192.png') %>",
6 | "sizes": "192x192",
7 | "type": "image/png"
8 | },
9 | {
10 | "src": "<%= image_path('favicons/android-chrome-512x512.png') %>",
11 | "sizes": "512x512",
12 | "type": "image/png"
13 | }
14 | ],
15 | "theme_color": "#ffffff",
16 | "background_color": "#ffffff",
17 | "display": "standalone"
18 | }
19 |
--------------------------------------------------------------------------------
/plugins/commands/status/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandStatus
5 | class Plugin < Vagrant.plugin("2")
6 | name "status command"
7 | description <<-DESC
8 | The `status` command shows what the running state (running/saved/..)
9 | is of all your virtual machines in this environment.
10 | DESC
11 |
12 | command("status") do
13 | require File.expand_path("../command", __FILE__)
14 | Command
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/communicators/winssh/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommunicatorWinSSH
5 | class Plugin < Vagrant.plugin("2")
6 | name "windows ssh communicator"
7 | description <<-DESC
8 | DESC
9 |
10 | communicator("winssh") do
11 | require File.expand_path("../communicator", __FILE__)
12 | Communicator
13 | end
14 |
15 | config("winssh") do
16 | require_relative "config"
17 | Config
18 | end
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/plugins/guests/funtoo/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestFuntoo
5 | class Plugin < Vagrant.plugin("2")
6 | name "Funtoo guest"
7 | description "Funtoo guest support."
8 |
9 | guest(:funtoo, :gentoo) do
10 | require_relative "guest"
11 | Guest
12 | end
13 |
14 | guest_capability(:funtoo, :configure_networks) do
15 | require_relative "cap/configure_networks"
16 | Cap::ConfigureNetworks
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/guests/nixos/guest.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestNixos
5 | class Guest < Vagrant.plugin("2", :guest)
6 | def detect?(machine)
7 | # For some reason our test passes on Windows, so just short
8 | # circuit because we're not Windows.
9 | if machine.config.vm.communicator == :winrm
10 | return false
11 | end
12 |
13 | machine.communicate.test("test -f /run/current-system/nixos-version")
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/package.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../../lib/vagrant/action/general/package"
2 |
3 | module VagrantPlugins
4 | module ProviderVirtualBox
5 | module Action
6 | class Package < Vagrant::Action::General::Package
7 | # Doing this so that we can test that the parent is properly
8 | # called in the unit tests.
9 | alias_method :general_call, :call
10 | def call(env)
11 | general_call(env)
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/provisioners/ansible/helpers.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module Ansible
5 | class Helpers
6 | def self.expand_path_in_unix_style(path, base_dir)
7 | # Remove the possible drive letter, which is added
8 | # by `File.expand_path` when running on a Windows host
9 | File.expand_path(path, base_dir).sub(/^[a-zA-Z]:/, "")
10 | end
11 |
12 | def self.as_list_argument(v)
13 | v.kind_of?(Array) ? v.join(',') : v
14 | end
15 | end
16 | end
17 | end
--------------------------------------------------------------------------------
/plugins/pushes/heroku/errors.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HerokuPush
3 | module Errors
4 | class Error < Vagrant::Errors::VagrantError
5 | error_namespace("heroku_push.errors")
6 | end
7 |
8 | class CommandFailed < Error
9 | error_key(:command_failed)
10 | end
11 |
12 | class GitNotFound < Error
13 | error_key(:git_not_found)
14 | end
15 |
16 | class NotAGitRepo < Error
17 | error_key(:not_a_git_repo)
18 | end
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/templates/guests/redhat/network_static.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # The contents below are automatically generated by Vagrant. Do not modify.
3 | NM_CONTROLLED=<%= options.fetch(:nm_controlled, "no") %>
4 | BOOTPROTO=none
5 | ONBOOT=yes
6 | IPADDR=<%= options[:ip] %>
7 | NETMASK=<%= options[:netmask] %>
8 | DEVICE=<%= options[:device] %>
9 | <% if options[:gateway] %>
10 | GATEWAY=<%= options[:gateway] %>
11 | <% end %>
12 | <% if options[:mac_address] %>
13 | HWADDR=<%= options[:mac_address] %>
14 | <% end %>
15 | PEERDNS=no
16 | #VAGRANT-END
17 |
--------------------------------------------------------------------------------
/lib/vagrant/action/builtin/box_update.rb:
--------------------------------------------------------------------------------
1 | require "log4r"
2 |
3 | module Vagrant
4 | module Action
5 | module Builtin
6 | # This middleware updates a specific box if there are updates available.
7 | class BoxUpdate
8 | def initialize(app, env)
9 | @app = app
10 | @logger = Log4r::Logger.new(
11 | "vagrant::action::builtin::box_update")
12 | end
13 |
14 | def call(env)
15 | machine = env[:machine]
16 | end
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/test/unit/vagrant/host_test.rb:
--------------------------------------------------------------------------------
1 | require "pathname"
2 |
3 | require File.expand_path("../../base", __FILE__)
4 |
5 | describe Vagrant::Host do
6 | include_context "capability_helpers"
7 |
8 | let(:capabilities) { {} }
9 | let(:hosts) { {} }
10 | let(:env) { Object.new }
11 |
12 | it "initializes the capabilities" do
13 | expect_any_instance_of(described_class).to receive(:initialize_capabilities!).
14 | with(:foo, hosts, capabilities, env)
15 |
16 | described_class.new(:foo, hosts, capabilities, env)
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/kernel_v1/config/nfs.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module Kernel_V1
5 | class NFSConfig < Vagrant.plugin("1", :config)
6 | attr_accessor :map_uid
7 | attr_accessor :map_gid
8 |
9 | def initialize
10 | @map_uid = UNSET_VALUE
11 | @map_gid = UNSET_VALUE
12 | end
13 |
14 | def upgrade(new)
15 | new.nfs.map_uid = @map_uid if @map_uid != UNSET_VALUE
16 | new.nfs.map_gid = @map_gid if @map_gid != UNSET_VALUE
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/providers/docker/action/prepare_nfs_valid_ids.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module DockerProvider
3 | module Action
4 | class PrepareNFSValidIds
5 | def initialize(app, env)
6 | @app = app
7 | @logger = Log4r::Logger.new("vagrant::action::vm::nfs")
8 | end
9 |
10 | def call(env)
11 | machine = env[:machine]
12 | env[:nfs_valid_ids] = machine.provider.driver.all_containers
13 |
14 | @app.call(env)
15 | end
16 | end
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/plugins/providers/docker/action/start.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module DockerProvider
3 | module Action
4 | class Start
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | machine = env[:machine]
11 | driver = machine.provider.driver
12 |
13 | machine.ui.output(I18n.t("docker_provider.messages.starting"))
14 | driver.start(machine.id)
15 |
16 | @app.call(env)
17 | end
18 | end
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/plugins/commands/ssh_config/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandSSHConfig
5 | class Plugin < Vagrant.plugin("2")
6 | name "ssh-config command"
7 | description <<-DESC
8 | The `ssh-config` command dumps an OpenSSH compatible configuration
9 | that can be used to quickly SSH into your virtual machine.
10 | DESC
11 |
12 | command("ssh-config") do
13 | require File.expand_path("../command", __FILE__)
14 | Command
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/setup_package_files.rb:
--------------------------------------------------------------------------------
1 | require "log4r"
2 |
3 | require_relative "package_setup_files"
4 |
5 | module VagrantPlugins
6 | module ProviderVirtualBox
7 | module Action
8 | class SetupPackageFiles < PackageSetupFiles
9 | def initialize(*)
10 | @logger = Log4r::Logger.new("vagrant::plugins::virtualbox::setup_package_files")
11 | @logger.warn { "SetupPackageFiles has been renamed to PackageSetupFiles" }
12 | super
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/suspend.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Action
4 | class Suspend
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | if env[:machine].state.id == :running
11 | env[:ui].info I18n.t("vagrant.actions.vm.suspend.suspending")
12 | env[:machine].provider.driver.suspend
13 | end
14 |
15 | @app.call(env)
16 | end
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/contrib/sudoers/linux-ubuntu:
--------------------------------------------------------------------------------
1 | # These work with Ubuntu - they might need tweaking for other distributions
2 |
3 | Cmnd_Alias VAGRANT_EXPORTS_CHOWN = /bin/chown 0\:0 /tmp/*
4 | Cmnd_Alias VAGRANT_EXPORTS_MV = /bin/mv -f /tmp/* /etc/exports
5 | Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status
6 | Cmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start
7 | Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
8 | %sudo ALL=(root) NOPASSWD: VAGRANT_EXPORTS_CHOWN, VAGRANT_EXPORTS_MV, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY
9 |
--------------------------------------------------------------------------------
/plugins/guests/tinycore/cap/rsync.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestTinyCore
3 | module Cap
4 | class RSync
5 | def self.rsync_install(machine)
6 | machine.communicate.tap do |comm|
7 | # Run it but don't error check because this is always failing currently
8 | comm.execute("tce-load -wi acl attr rsync", error_check: false)
9 |
10 | # Verify it by executing rsync
11 | comm.execute("rsync --help")
12 | end
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/action/package_setup_files.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../../lib/vagrant/action/general/package_setup_files"
2 |
3 | module VagrantPlugins
4 | module HyperV
5 | module Action
6 | class PackageSetupFiles < Vagrant::Action::General::PackageSetupFiles
7 | # Doing this so that we can test that the parent is properly
8 | # called in the unit tests.
9 | alias_method :general_call, :call
10 | def call(env)
11 | general_call(env)
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/test/unit/plugins/guests/pld/cap/flavor_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../../base"
2 |
3 | describe "VagrantPlugins::GuestPld::Cap::Flavor" do
4 | let(:caps) do
5 | VagrantPlugins::GuestPld::Plugin
6 | .components
7 | .guest_capabilities[:pld]
8 | end
9 |
10 | let(:machine) { double("machine") }
11 |
12 | describe ".flavor" do
13 | let(:cap) { caps.get(:flavor) }
14 |
15 | let(:name) { "banana-rama.example.com" }
16 |
17 | it "is pld" do
18 | expect(cap.flavor(machine)).to be(:pld)
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/website/source/docs/vagrant-cloud/organizations/create.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: "vagrant-cloud"
3 | page_title: "Create an Organization"
4 | sidebar_current: "vagrant-cloud-organizations-create"
5 | ---
6 |
7 | # Create an Organization
8 |
9 | To create an organization:
10 |
11 | 1. Create a personal account. You'll use this to create and administrate the
12 | organization. You'll be able to add other users as owners of the organization,
13 | so it won't be tied solely to your account.
14 |
15 | 1. Visit your new organization page to create the organization.
16 |
--------------------------------------------------------------------------------
/plugins/commands/destroy/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandDestroy
5 | class Plugin < Vagrant.plugin("2")
6 | name "destroy command"
7 | description <<-DESC
8 | The `destroy` command deletes and removes the files and record of your virtual machines.
9 | All data is lost and a new VM will have to be created using `up`
10 | DESC
11 |
12 | command("destroy") do
13 | require File.expand_path("../command", __FILE__)
14 | Command
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/commands/global-status/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandGlobalStatus
5 | class Plugin < Vagrant.plugin("2")
6 | name "global-status command"
7 | description <<-DESC
8 | The `global-status` command shows what the running state (running/saved/..)
9 | is of all the Vagrant environments known to the system.
10 | DESC
11 |
12 | command("global-status") do
13 | require File.expand_path("../command", __FILE__)
14 | Command
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/commands/plugin/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandPlugin
5 | class Plugin < Vagrant.plugin("2")
6 | name "plugin command"
7 | description <<-DESC
8 | This command helps manage and install plugins within the
9 | Vagrant environment.
10 | DESC
11 |
12 | command("plugin") do
13 | require File.expand_path("../command/root", __FILE__)
14 | Command::Root
15 | end
16 | end
17 |
18 | autoload :Action, File.expand_path("../action", __FILE__)
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/guests/windows/cap/halt.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestWindows
3 | module Cap
4 | module Halt
5 | def self.halt(machine)
6 | # Fix vagrant-windows GH-129, if there's an existing scheduled
7 | # reboot cancel it so shutdown succeeds
8 | machine.communicate.execute("shutdown -a", error_check: false)
9 |
10 | # Force shutdown the machine now
11 | machine.communicate.execute("shutdown /s /t 1 /c \"Vagrant Halt\" /f /d p:4:1")
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/test/unit/plugins/guests/linux/cap/mount_shared_folder_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../../base"
2 |
3 | describe "VagrantPlugins::GuestLinux::Cap::MountSharedFolder" do
4 | let(:machine) { double("machine") }
5 | let(:communicator) { VagrantTests::DummyCommunicator::Communicator.new(machine) }
6 | let(:guest) { double("guest") }
7 |
8 | before do
9 | allow(machine).to receive(:guest).and_return(guest)
10 | allow(machine).to receive(:communicate).and_return(communicator)
11 | allow(guest).to receive(:capability).and_return(nil)
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/test/unit/templates/guests/netbsd/network_dhcp_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../base"
2 |
3 | require "vagrant/util/template_renderer"
4 |
5 | describe "templates/guests/netbsd/network_dhcp" do
6 | let(:template) { "guests/netbsd/network_dhcp" }
7 |
8 | it "renders the template" do
9 | result = Vagrant::Util::TemplateRenderer.render(template, options: {
10 | interface: "en0",
11 | })
12 | expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
13 | #VAGRANT-BEGIN
14 | ifconfig_wmen0=dhcp
15 | #VAGRANT-END
16 | EOH
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/guests/linux/cap/read_ip_address.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestLinux
3 | module Cap
4 | class ReadIPAddress
5 | def self.read_ip_address(machine)
6 | command = "LANG=en ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1 }'"
7 | result = ""
8 | machine.communicate.sudo(command) do |type, data|
9 | result << data if type == :stdout
10 | end
11 |
12 | result.chomp.split("\n").first
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/templates/package_Vagrantfile.erb:
--------------------------------------------------------------------------------
1 | Vagrant::Config.run do |config|
2 | # This Vagrantfile is auto-generated by `vagrant package` to contain
3 | # the MAC address of the box. Custom configuration should be placed in
4 | # the actual `Vagrantfile` in this box.
5 | config.vm.base_mac = "<%= base_mac %>"
6 | end
7 |
8 | # Load include vagrant file if it exists after the auto-generated
9 | # so it can override any of the settings
10 | include_vagrantfile = File.expand_path("../include/_Vagrantfile", __FILE__)
11 | load include_vagrantfile if File.exist?(include_vagrantfile)
12 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/package_setup_files.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../../lib/vagrant/action/general/package_setup_files"
2 |
3 | module VagrantPlugins
4 | module ProviderVirtualBox
5 | module Action
6 | class PackageSetupFiles < Vagrant::Action::General::PackageSetupFiles
7 | # Doing this so that we can test that the parent is properly
8 | # called in the unit tests.
9 | alias_method :general_call, :call
10 | def call(env)
11 | general_call(env)
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/plugins/provisioners/salt/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module Salt
5 | class Plugin < Vagrant.plugin("2")
6 | name "salt"
7 | description <<-DESC
8 | Provisions virtual machines using SaltStack
9 | DESC
10 |
11 | config(:salt, :provisioner) do
12 | require File.expand_path("../config", __FILE__)
13 | Config
14 | end
15 |
16 | provisioner(:salt) do
17 | require File.expand_path("../provisioner", __FILE__)
18 | Provisioner
19 | end
20 | end
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/tasks/acceptance.rake:
--------------------------------------------------------------------------------
1 | namespace :acceptance do
2 | desc "shows components that can be tested"
3 | task :components do
4 | exec("vagrant-spec components --config=vagrant-spec.config.rb")
5 | end
6 |
7 | desc "runs acceptance tests"
8 | task :run do
9 | args = [
10 | "--config=vagrant-spec.config.rb",
11 | ]
12 |
13 | if ENV["COMPONENTS"]
14 | args << "--components=\"#{ENV["COMPONENTS"]}\""
15 | end
16 |
17 | command = "vagrant-spec test #{args.join(" ")}"
18 | puts command
19 | puts
20 | exec(command)
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/plugins/guests/darwin/cap/choose_addressable_ip_addr.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestDarwin
3 | module Cap
4 | module ChooseAddressableIPAddr
5 | def self.choose_addressable_ip_addr(machine, possible)
6 | comm = machine.communicate
7 |
8 | possible.each do |ip|
9 | if comm.test("ping -c1 -t1 #{ip}")
10 | return ip
11 | end
12 | end
13 |
14 | # If we got this far, there are no addressable IPs
15 | return nil
16 | end
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/guests/windows/cap/choose_addressable_ip_addr.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestWindows
3 | module Cap
4 | module ChooseAddressableIPAddr
5 | def self.choose_addressable_ip_addr(machine, possible)
6 | machine.communicate.tap do |comm|
7 | possible.each do |ip|
8 | command = "ping -n 1 -w 1 #{ip}"
9 | if comm.test(command)
10 | return ip
11 | end
12 | end
13 | end
14 |
15 | nil
16 | end
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/discard_state.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Action
4 | class DiscardState
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | if env[:machine].state.id == :saved
11 | env[:ui].info I18n.t("vagrant.actions.vm.discard_state.discarding")
12 | env[:machine].provider.driver.discard_saved_state
13 | end
14 |
15 | @app.call(env)
16 | end
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/templates/guests/debian/network_dhcp.erb:
--------------------------------------------------------------------------------
1 | #VAGRANT-BEGIN
2 | # The contents below are automatically generated by Vagrant. Do not modify.
3 | auto <%= options[:device] %>
4 | iface <%= options[:device] %> inet dhcp
5 | <% if !options[:use_dhcp_assigned_default_route] %>
6 | post-up route del default dev $IFACE || true
7 | <% else %>
8 | # We need to disable eth0, see GH-2648
9 | post-up route del default dev <%= options[:root_device] %> || true
10 | post-up dhclient $IFACE
11 | pre-down route add default dev <%= options[:root_device] %>
12 | <% end %>
13 | #VAGRANT-END
14 |
--------------------------------------------------------------------------------
/website/source/sitemap.xml.builder:
--------------------------------------------------------------------------------
1 | ---
2 | layout: false
3 | ---
4 |
5 | xml.instruct!
6 | xml.urlset 'xmlns' => "http://www.sitemaps.org/schemas/sitemap/0.9" do
7 | sitemap
8 | .resources
9 | .select { |page| page.path =~ /\.html/ }
10 | .select { |page| !page.data.noindex }
11 | .each do |page|
12 | xml.url do
13 | xml.loc File.join(base_url, page.url)
14 | xml.lastmod Date.today.to_time.iso8601
15 | xml.changefreq page.data.changefreq || "monthly"
16 | xml.priority page.data.priority || "0.5"
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/plugins/communicators/ssh/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommunicatorSSH
5 | class Plugin < Vagrant.plugin("2")
6 | name "ssh communicator"
7 | description <<-DESC
8 | This plugin allows Vagrant to communicate with remote machines using
9 | SSH as the underlying protocol, powered internally by Ruby's
10 | net-ssh library.
11 | DESC
12 |
13 | communicator("ssh") do
14 | require File.expand_path("../communicator", __FILE__)
15 | Communicator
16 | end
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/action/net_set_mac.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HyperV
3 | module Action
4 | class NetSetMac
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | mac = env[:machine].provider_config.mac
11 | if mac
12 | env[:ui].info("[Settings] [Network Adapter] Setting MAC address to: #{mac}")
13 | env[:machine].provider.driver.net_set_mac(mac)
14 | end
15 | @app.call(env)
16 | end
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/scripts/set_network_vlan.ps1:
--------------------------------------------------------------------------------
1 | param (
2 | [string]$VmId = $(throw "-VmId is required."),
3 | [int]$VlanId = $(throw "-VlanId ")
4 | )
5 |
6 | # Include the following modules
7 | $presentDir = Split-Path -parent $PSCommandPath
8 | $modules = @()
9 | $modules += $presentDir + "\utils\write_messages.ps1"
10 | forEach ($module in $modules) { . $module }
11 |
12 | try {
13 | $vm = Get-VM -Id $VmId -ErrorAction "stop"
14 | Set-VMNetworkAdapterVlan $vm -Access -Vlanid $VlanId
15 | }
16 | catch {
17 | Write-Error-Message "Failed to set VM's Vlan ID $_"
18 | }
19 |
--------------------------------------------------------------------------------
/website/source/docs/vagrant-cloud/organizations/index.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: "vagrant-cloud"
3 | page_page_title: "Organizations in Vagrant Cloud"
4 | sidebar_current: "vagrant-cloud-organizations"
5 | ---
6 |
7 | ## Organizations in Vagrant Cloud
8 |
9 | Organizations are a group of users in Vagrant Cloud that have access and
10 | ownership over shared resources. When operating within a team, we recommend
11 | creating an organization to manage access control, auditing, billing and
12 | authorization.
13 |
14 | Each individual member of your organization should have their own account.
15 |
--------------------------------------------------------------------------------
/plugins/providers/docker/action/init_state.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module DockerProvider
3 | module Action
4 | class InitState
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | # We set the ID of the machine to "preparing" so that we can use
11 | # the data dir without it being deleted with the not_created state.
12 | env[:machine].id = nil
13 | env[:machine].id = "preparing"
14 |
15 | @app.call(env)
16 | end
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/action/snapshot_restore.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HyperV
3 | module Action
4 | class SnapshotRestore
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 |
11 | env[:ui].info(I18n.t(
12 | "vagrant.actions.vm.snapshot.restoring",
13 | name: env[:snapshot_name]))
14 |
15 | env[:machine].provider.driver.restore_snapshot(env[:snapshot_name])
16 |
17 | @app.call(env)
18 |
19 | end
20 | end
21 | end
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/test/unit/vagrant/plugin/v1/provider_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../../../../base", __FILE__)
2 |
3 | describe Vagrant::Plugin::V1::Provider do
4 | let(:machine) { Object.new }
5 | let(:instance) { described_class.new(machine) }
6 |
7 | it "should return nil by default for actions" do
8 | expect(instance.action(:whatever)).to be_nil
9 | end
10 |
11 | it "should return nil by default for ssh info" do
12 | expect(instance.ssh_info).to be_nil
13 | end
14 |
15 | it "should return nil by default for state" do
16 | expect(instance.state).to be_nil
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/action/package_setup_folders.rb:
--------------------------------------------------------------------------------
1 | require "fileutils"
2 |
3 | require_relative "../../../../lib/vagrant/action/general/package_setup_folders"
4 |
5 | module VagrantPlugins
6 | module HyperV
7 | module Action
8 | class PackageSetupFolders < Vagrant::Action::General::PackageSetupFolders
9 | # Doing this so that we can test that the parent is properly
10 | # called in the unit tests.
11 | alias_method :general_call, :call
12 | def call(env)
13 | general_call(env)
14 | end
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/lib/vagrant/config/v2/util.rb:
--------------------------------------------------------------------------------
1 | module Vagrant
2 | module Config
3 | module V2
4 | class Util
5 | # This merges two error hashes from validate methods.
6 | #
7 | # @param [Hash] first
8 | # @param [Hash] second
9 | # @return [Hash] Merged result
10 | def self.merge_errors(first, second)
11 | first.dup.tap do |result|
12 | second.each do |key, value|
13 | result[key] ||= []
14 | result[key] += value
15 | end
16 | end
17 | end
18 | end
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/scripts/set_network_mac.ps1:
--------------------------------------------------------------------------------
1 | param (
2 | [string]$VmId = $(throw "-VmId is required."),
3 | [string]$Mac = $(throw "-Mac ")
4 | )
5 |
6 | # Include the following modules
7 | $presentDir = Split-Path -parent $PSCommandPath
8 | $modules = @()
9 | $modules += $presentDir + "\utils\write_messages.ps1"
10 | forEach ($module in $modules) { . $module }
11 |
12 | try {
13 | $vm = Get-VM -Id $VmId -ErrorAction "stop"
14 | Set-VMNetworkAdapter $vm -StaticMacAddress $Mac -ErrorAction "stop"
15 | }
16 | catch {
17 | Write-Error-Message "Failed to set VM's MAC address $_"
18 | }
19 |
--------------------------------------------------------------------------------
/plugins/provisioners/ansible/cap/guest/facts.rb:
--------------------------------------------------------------------------------
1 |
2 | module VagrantPlugins
3 | module Ansible
4 | module Cap
5 | module Guest
6 | module Facts
7 |
8 | def self.dnf?(machine)
9 | machine.communicate.test "/usr/bin/which -s dnf"
10 | end
11 |
12 | def self.yum?(machine)
13 | machine.communicate.test "/usr/bin/which -s yum"
14 | end
15 |
16 | def self.rpm_package_manager(machine)
17 | dnf?(machine) ? "dnf" : "yum"
18 | end
19 |
20 | end
21 | end
22 | end
23 | end
24 | end
25 |
--------------------------------------------------------------------------------
/test/unit/plugins/kernel_v2/config/vagrant_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../../../../base", __FILE__)
2 |
3 | require Vagrant.source_root.join("plugins/kernel_v2/config/vagrant")
4 |
5 | describe VagrantPlugins::Kernel_V2::VagrantConfig do
6 | subject { described_class.new }
7 |
8 | describe "#host" do
9 | it "defaults to :detect" do
10 | subject.finalize!
11 | expect(subject.host).to eq(:detect)
12 | end
13 |
14 | it "symbolizes" do
15 | subject.host = "foo"
16 | subject.finalize!
17 | expect(subject.host).to eq(:foo)
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/commands/login/errors.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module LoginCommand
3 | module Errors
4 | class Error < Vagrant::Errors::VagrantError
5 | error_namespace("login_command.errors")
6 | end
7 |
8 | class ServerError < Error
9 | error_key(:server_error)
10 | end
11 |
12 | class ServerUnreachable < Error
13 | error_key(:server_unreachable)
14 | end
15 |
16 | class Unauthorized < Error
17 | error_key(:unauthorized)
18 | end
19 |
20 | class TwoFactorRequired < Error
21 | end
22 | end
23 | end
24 | end
25 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/action/net_set_vlan.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HyperV
3 | module Action
4 | class NetSetVLan
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | vlan_id = env[:machine].provider_config.vlan_id
11 | if vlan_id
12 | env[:ui].info("[Settings] [Network Adapter] Setting Vlan ID to: #{vlan_id}")
13 | env[:machine].provider.driver.net_set_vlan(vlan_id)
14 | end
15 | @app.call(env)
16 | end
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/provisioners/chef/cap/freebsd/chef_install.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../omnibus"
2 |
3 | module VagrantPlugins
4 | module Chef
5 | module Cap
6 | module FreeBSD
7 | module ChefInstall
8 | def self.chef_install(machine, project, version, channel, omnibus_url, options = {})
9 | machine.communicate.sudo("pkg install -y -qq curl bash")
10 |
11 | command = Omnibus.sh_command(project, version, channel, omnibus_url, options)
12 | machine.communicate.sudo(command)
13 | end
14 | end
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/test/unit/plugins/guests/suse/cap/network_scripts_dir_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../../base"
2 |
3 | describe "VagrantPlugins::GuestSUSE::Cap::NetworkScriptsDir" do
4 | let(:caps) do
5 | VagrantPlugins::GuestSUSE::Plugin
6 | .components
7 | .guest_capabilities[:suse]
8 | end
9 |
10 | let(:machine) { double("machine") }
11 |
12 | describe ".network_scripts_dir" do
13 | let(:cap) { caps.get(:network_scripts_dir) }
14 |
15 | it "runs /etc/sysconfig/network" do
16 | expect(cap.network_scripts_dir(machine)).to eq("/etc/sysconfig/network")
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/test/unit/templates/guests/freebsd/network_dhcp_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../base"
2 |
3 | require "vagrant/util/template_renderer"
4 |
5 | describe "templates/guests/freebsd/network_dhcp" do
6 | let(:template) { "guests/freebsd/network_dhcp" }
7 |
8 | it "renders the template" do
9 | result = Vagrant::Util::TemplateRenderer.render(template, options: {
10 | device: "eth1",
11 | })
12 | expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
13 | #VAGRANT-BEGIN
14 | ifconfig_eth1="DHCP"
15 | synchronous_dhclient="YES"
16 | #VAGRANT-END
17 | EOH
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/package_setup_folders.rb:
--------------------------------------------------------------------------------
1 | require "fileutils"
2 |
3 | require_relative "../../../../lib/vagrant/action/general/package_setup_folders"
4 |
5 | module VagrantPlugins
6 | module ProviderVirtualBox
7 | module Action
8 | class PackageSetupFolders < Vagrant::Action::General::PackageSetupFolders
9 | # Doing this so that we can test that the parent is properly
10 | # called in the unit tests.
11 | alias_method :general_call, :call
12 | def call(env)
13 | general_call(env)
14 | end
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/test/unit/templates/guests/arch/network_dhcp_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../base"
2 |
3 | require "vagrant/util/template_renderer"
4 |
5 | describe "templates/guests/arch/network_dhcp" do
6 | let(:template) { "guests/arch/network_dhcp" }
7 |
8 | it "renders the template" do
9 | result = Vagrant::Util::TemplateRenderer.render(template, options: {
10 | device: "eth1",
11 | })
12 | expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
13 | Description='A basic dhcp ethernet connection'
14 | Interface=eth1
15 | Connection=ethernet
16 | IP=dhcp
17 | EOH
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/website/source/assets/stylesheets/_footer.scss:
--------------------------------------------------------------------------------
1 | #footer {
2 | padding-top: 50px;
3 |
4 | ul.footer-links {
5 | li {
6 | a {
7 | color: $footer-link-color;
8 | font-size: $footer-font-size;
9 | font-family: $font-family-open-sans;
10 | text-decoration: none;
11 |
12 | &:hover, &:focus, &:active {
13 | background-color: transparent;
14 | color: $footer-link-color-hover;
15 | outline: 0;
16 | }
17 |
18 | @media (max-width: 992px) {
19 | text-align: center;
20 | }
21 | }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/website/source/docs/cli/rsync.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: "docs"
3 | page_title: "vagrant rsync - Command-Line Interface"
4 | sidebar_current: "cli-rsync"
5 | description: |-
6 | The "vagrant rsync" command forces a re-sync of any rsync synced folders.
7 | ---
8 |
9 | # Rsync
10 |
11 | **Command: `vagrant rsync`**
12 |
13 | This command forces a re-sync of any
14 | [rsync synced folders](/docs/synced-folders/rsync.html).
15 |
16 | Note that if you change any settings within the rsync synced folders such
17 | as exclude paths, you will need to `vagrant reload` before this command will
18 | pick up those changes.
19 |
--------------------------------------------------------------------------------
/contrib/sudoers/linux-fedora:
--------------------------------------------------------------------------------
1 | Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
2 | Cmnd_Alias VAGRANT_NFSD_CHECK = /usr/bin/systemctl status --no-pager nfs-server.service
3 | Cmnd_Alias VAGRANT_NFSD_START = /usr/bin/systemctl start nfs-server.service
4 | Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
5 | Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -r -e * d -ibak /*/exports
6 | Cmnd_Alias VAGRANT_EXPORTS_REMOVE_2 = /bin/cp /*/exports /etc/exports
7 | %vagrant ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY, VAGRANT_EXPORTS_REMOVE, VAGRANT_EXPORTS_REMOVE_2
8 |
--------------------------------------------------------------------------------
/plugins/guests/netbsd/cap/change_host_name.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestNetBSD
3 | module Cap
4 | class ChangeHostName
5 | def self.change_host_name(machine, name)
6 | if !machine.communicate.test("hostname -s | grep '^#{name}$'")
7 | machine.communicate.sudo(< /tmp/rc.conf.vagrant_changehostname_#{name} &&
9 | mv /tmp/rc.conf.vagrant_changehostname_#{name} /etc/rc.conf &&
10 | hostname #{name}
11 | CMDS
12 | end
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/website/Makefile:
--------------------------------------------------------------------------------
1 | VERSION?="0.3.29"
2 |
3 | build:
4 | @echo "==> Starting build in Docker..."
5 | @docker run \
6 | --interactive \
7 | --rm \
8 | --tty \
9 | --volume "$(shell pwd):/website" \
10 | hashicorp/middleman-hashicorp:${VERSION} \
11 | bundle exec middleman build --verbose --clean
12 |
13 | website:
14 | @echo "==> Starting website in Docker..."
15 | @docker run \
16 | --interactive \
17 | --rm \
18 | --tty \
19 | --publish "4567:4567" \
20 | --publish "35729:35729" \
21 | --volume "$(shell pwd):/website" \
22 | hashicorp/middleman-hashicorp:${VERSION}
23 |
24 | .PHONY: build website
25 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | require 'rubygems'
2 | require 'bundler/setup'
3 |
4 | # Immediately sync all stdout so that tools like buildbot can
5 | # immediately load in the output.
6 | $stdout.sync = true
7 | $stderr.sync = true
8 |
9 | # Load all the rake tasks from the "tasks" folder. This folder
10 | # allows us to nicely separate rake tasks into individual files
11 | # based on their role, which makes development and debugging easier
12 | # than one monolithic file.
13 | task_dir = File.expand_path("../tasks", __FILE__)
14 | Dir["#{task_dir}/**/*.rake"].each do |task_file|
15 | load task_file
16 | end
17 |
18 | task default: "test:unit"
19 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/clear_forwarded_ports.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Action
4 | class ClearForwardedPorts
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | if !env[:machine].provider.driver.read_forwarded_ports.empty?
11 | env[:ui].info I18n.t("vagrant.actions.vm.clear_forward_ports.deleting")
12 | env[:machine].provider.driver.clear_forwarded_ports
13 | end
14 |
15 | @app.call(env)
16 | end
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/provisioners/file/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module FileUpload
5 | class Plugin < Vagrant.plugin("2")
6 | name "file"
7 | description <<-DESC
8 | Provides support for provisioning your virtual machines with
9 | uploaded files.
10 | DESC
11 |
12 | config(:file, :provisioner) do
13 | require File.expand_path("../config", __FILE__)
14 | Config
15 | end
16 |
17 | provisioner(:file) do
18 | require File.expand_path("../provisioner", __FILE__)
19 | Provisioner
20 | end
21 | end
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/plugins/provisioners/shell/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module Shell
5 | class Plugin < Vagrant.plugin("2")
6 | name "shell"
7 | description <<-DESC
8 | Provides support for provisioning your virtual machines with
9 | shell scripts.
10 | DESC
11 |
12 | config(:shell, :provisioner) do
13 | require File.expand_path("../config", __FILE__)
14 | Config
15 | end
16 |
17 | provisioner(:shell) do
18 | require File.expand_path("../provisioner", __FILE__)
19 | Provisioner
20 | end
21 | end
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/lib/vagrant/util/deep_merge.rb:
--------------------------------------------------------------------------------
1 | module Vagrant
2 | module Util
3 | module DeepMerge
4 | # This was lifted straight from Rails 4.0.2 as a basic Hash
5 | # deep merge.
6 | def self.deep_merge(myself, other_hash, &block)
7 | myself = myself.dup
8 | other_hash.each_pair do |k,v|
9 | tv = myself[k]
10 | if tv.is_a?(Hash) && v.is_a?(Hash)
11 | myself[k] = deep_merge(tv, v, &block)
12 | else
13 | myself[k] = block && tv ? block.call(k, tv, v) : v
14 | end
15 | end
16 | myself
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/guests/windows/config.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestWindows
3 | class Config < Vagrant.plugin("2", :config)
4 | attr_accessor :set_work_network
5 |
6 | def initialize
7 | @set_work_network = UNSET_VALUE
8 | end
9 |
10 | def validate(machine)
11 | errors = []
12 |
13 | errors << "windows.set_work_network cannot be nil." if @set_work_network.nil?
14 |
15 | { "Windows Guest" => errors }
16 | end
17 |
18 | def finalize!
19 | @set_work_network = false if @set_work_network == UNSET_VALUE
20 | end
21 | end
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/plugins/providers/docker/action/stop.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module DockerProvider
3 | module Action
4 | class Stop
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | machine = env[:machine]
11 | driver = machine.provider.driver
12 | if driver.running?(machine.id)
13 | env[:ui].info I18n.t("docker_provider.messages.stopping")
14 | driver.stop(machine.id, machine.provider_config.stop_timeout)
15 | end
16 | @app.call(env)
17 | end
18 | end
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/plugins/providers/hyperv/action/check_enabled.rb:
--------------------------------------------------------------------------------
1 | require "fileutils"
2 |
3 | require "log4r"
4 |
5 | module VagrantPlugins
6 | module HyperV
7 | module Action
8 | class CheckEnabled
9 | def initialize(app, env)
10 | @app = app
11 | end
12 |
13 | def call(env)
14 | env[:ui].output("Verifying Hyper-V is enabled...")
15 | result = env[:machine].provider.driver.execute("check_hyperv.ps1", {})
16 | raise Errors::PowerShellFeaturesDisabled if !result["result"]
17 |
18 | @app.call(env)
19 | end
20 | end
21 | end
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/is_paused.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Action
4 | class IsPaused
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | # Set the result to be true if the machine is paused.
11 | env[:result] = env[:machine].state.id == :paused
12 |
13 | # Call the next if we have one (but we shouldn't, since this
14 | # middleware is built to run with the Call-type middlewares)
15 | @app.call(env)
16 | end
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/is_saved.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Action
4 | class IsSaved
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | # Set the result to be true if the machine is saved.
11 | env[:result] = env[:machine].state.id == :saved
12 |
13 | # Call the next if we have one (but we shouldn't, since this
14 | # middleware is built to run with the Call-type middlewares)
15 | @app.call(env)
16 | end
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/test/unit/plugins/guests/alt/cap/network_scripts_dir_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../../base"
2 |
3 | describe "VagrantPlugins::GuestALT::Cap::NetworkScriptsDir" do
4 | let(:caps) do
5 | VagrantPlugins::GuestALT::Plugin
6 | .components
7 | .guest_capabilities[:alt]
8 | end
9 |
10 | let(:machine) { double("machine") }
11 |
12 | describe ".network_scripts_dir" do
13 | let(:cap) { caps.get(:network_scripts_dir) }
14 |
15 | let(:name) { "banana-rama.example.com" }
16 |
17 | it "is /etc/net" do
18 | expect(cap.network_scripts_dir(machine)).to eq("/etc/net")
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/created.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Action
4 | class Created
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | # Set the result to be true if the machine is created.
11 | env[:result] = env[:machine].state.id != :not_created
12 |
13 | # Call the next if we have one (but we shouldn't, since this
14 | # middleware is built to run with the Call-type middlewares)
15 | @app.call(env)
16 | end
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/is_running.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Action
4 | class IsRunning
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | # Set the result to be true if the machine is running.
11 | env[:result] = env[:machine].state.id == :running
12 |
13 | # Call the next if we have one (but we shouldn't, since this
14 | # middleware is built to run with the Call-type middlewares)
15 | @app.call(env)
16 | end
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/check_created.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Action
4 | # This middleware checks that the VM is created, and raises an exception
5 | # if it is not, notifying the user that creation is required.
6 | class CheckCreated
7 | def initialize(app, env)
8 | @app = app
9 | end
10 |
11 | def call(env)
12 | if env[:machine].state.id == :not_created
13 | raise Vagrant::Errors::VMNotCreatedError
14 | end
15 |
16 | @app.call(env)
17 | end
18 | end
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/check_running.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Action
4 | # This middleware checks that the VM is running, and raises an exception
5 | # if it is not, notifying the user that the VM must be running.
6 | class CheckRunning
7 | def initialize(app, env)
8 | @app = app
9 | end
10 |
11 | def call(env)
12 | if env[:machine].state.id != :running
13 | raise Vagrant::Errors::VMNotRunningError
14 | end
15 |
16 | @app.call(env)
17 | end
18 | end
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/test/unit/templates/guests/funtoo/network_dhcp_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../base"
2 |
3 | require "vagrant/util/template_renderer"
4 |
5 | describe "templates/guests/funtoo/network_dhcp" do
6 | let(:template) { "guests/funtoo/network_dhcp" }
7 |
8 | it "renders the template" do
9 | result = Vagrant::Util::TemplateRenderer.render(template, options: {
10 | device: "en0",
11 | })
12 | expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
13 | #VAGRANT-BEGIN
14 | # The contents below are automatically generated by Vagrant. Do not modify.
15 | template='dhcp'
16 | #VAGRANT-END
17 | EOH
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/plugins/guests/omnios/cap/mount_nfs_folder.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestOmniOS
3 | module Cap
4 | class MountNFSFolder
5 | def self.mount_nfs_folder(machine, ip, folders)
6 | comm = machine.communicate
7 | commands = []
8 |
9 | folders.each do |_, opts|
10 | commands << <<-EOH.gsub(/^ {14}/, '')
11 | mkdir -p '#{opts[:guestpath]}'
12 | /sbin/mount '#{ip}:#{opts[:hostpath]}' '#{opts[:guestpath]}'
13 | EOH
14 | end
15 |
16 | comm.sudo(commands.join("\n"))
17 | end
18 | end
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/plugins/guests/solaris/cap/change_host_name.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestSolaris
3 | module Cap
4 | class ChangeHostName
5 | def self.change_host_name(machine, name)
6 | su_cmd = machine.config.solaris.suexec_cmd
7 |
8 | # Only do this if the hostname is not already set
9 | if !machine.communicate.test("#{su_cmd} hostname | grep '#{name}'")
10 | machine.communicate.execute("#{su_cmd} sh -c \"echo '#{name}' > /etc/nodename\"")
11 | machine.communicate.execute("#{su_cmd} uname -S #{name}")
12 | end
13 | end
14 | end
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/plugins/providers/virtualbox/action/boot.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module ProviderVirtualBox
3 | module Action
4 | class Boot
5 | def initialize(app, env)
6 | @app = app
7 | end
8 |
9 | def call(env)
10 | @env = env
11 |
12 | boot_mode = @env[:machine].provider_config.gui ? "gui" : "headless"
13 |
14 | # Start up the VM and wait for it to boot.
15 | env[:ui].info I18n.t("vagrant.actions.vm.boot.booting")
16 | env[:machine].provider.driver.start(boot_mode)
17 |
18 | @app.call(env)
19 | end
20 | end
21 | end
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/plugins/provisioners/cfengine/cap/suse/cfengine_install.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module CFEngine
3 | module Cap
4 | module SUSE
5 | module CFEngineInstall
6 | def self.cfengine_install(machine, config)
7 | machine.communicate.tap do |comm|
8 | comm.sudo("rpm --import #{config.repo_gpg_key_url}")
9 |
10 | comm.sudo("zypper addrepo -t YUM #{config.yum_repo_url} CFEngine")
11 | comm.sudo("zypper se #{config.package_name} && zypper -n install #{config.package_name}")
12 | end
13 | end
14 | end
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/test/unit/templates/guests/gentoo/network_dhcp_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../base"
2 |
3 | require "vagrant/util/template_renderer"
4 |
5 | describe "templates/guests/gentoo/network_dhcp" do
6 | let(:template) { "guests/gentoo/network_dhcp" }
7 |
8 | it "renders the template" do
9 | result = Vagrant::Util::TemplateRenderer.render(template, options: {
10 | device: "en0",
11 | })
12 | expect(result).to eq <<-EOH.gsub(/^ {6}/, "")
13 | #VAGRANT-BEGIN
14 | # The contents below are automatically generated by Vagrant. Do not modify.
15 | config_en0="dhcp"
16 | #VAGRANT-END
17 | EOH
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/lib/vagrant/plugin/v2/host.rb:
--------------------------------------------------------------------------------
1 | module Vagrant
2 | module Plugin
3 | module V2
4 | # Base class for a host in Vagrant. A host class contains functionality
5 | # that is specific to a specific OS that is running Vagrant. This
6 | # abstraction is done becauase there is some host-specific logic that
7 | # Vagrant must do in some cases.
8 | class Host
9 | # This returns true/false depending on if the current running system
10 | # matches the host class.
11 | #
12 | # @return [Boolean]
13 | def detect?(env)
14 | false
15 | end
16 | end
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/lib/vagrant/util/counter.rb:
--------------------------------------------------------------------------------
1 | require 'thread'
2 |
3 | module Vagrant
4 | module Util
5 | # Atomic counter implementation. This is useful for incrementing
6 | # a counter which is guaranteed to only be used once in its class.
7 | module Counter
8 | def get_and_update_counter(name=nil)
9 | name ||= :global
10 |
11 | mutex.synchronize do
12 | @__counter ||= Hash.new(1)
13 | result = @__counter[name]
14 | @__counter[name] += 1
15 | result
16 | end
17 | end
18 |
19 | def mutex
20 | @__counter_mutex ||= Mutex.new
21 | end
22 | end
23 | end
24 | end
25 |
--------------------------------------------------------------------------------
/plugins/commands/powershell/errors.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module CommandPS
3 | module Errors
4 | # A convenient superclass for all our errors.
5 | class PSCommandError < Vagrant::Errors::VagrantError
6 | error_namespace("vagrant_ps.errors")
7 | end
8 |
9 | class HostUnsupported < PSCommandError
10 | error_key(:host_unsupported)
11 | end
12 |
13 | class PSRemotingUndetected < PSCommandError
14 | error_key(:ps_remoting_undetected)
15 | end
16 |
17 | class PowerShellError < PSCommandError
18 | error_key(:powershell_error)
19 | end
20 | end
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/plugins/guests/darwin/cap/halt.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestDarwin
3 | module Cap
4 | class Halt
5 | def self.halt(machine)
6 | begin
7 | # Darwin does not support the `-p` option like the rest of the
8 | # BSD-based guests, so it needs its own cap.
9 | machine.communicate.sudo("/sbin/shutdown -h now")
10 | rescue IOError, Vagrant::Errors::SSHDisconnected
11 | # Do nothing because SSH connection closed and it probably
12 | # means the VM just shut down really fast.
13 | end
14 | end
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/plugins/guests/fedora/cap/flavor.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestFedora
3 | module Cap
4 | class Flavor
5 | def self.flavor(machine)
6 | # Read the version file
7 | version = nil
8 | machine.communicate.sudo("grep VERSION_ID /etc/os-release") do |type, data|
9 | if type == :stdout
10 | version = data.split("=")[1].chomp.to_i
11 | end
12 | end
13 |
14 | if version.nil?
15 | return :fedora
16 | else
17 | return :"fedora_#{version}"
18 | end
19 | end
20 | end
21 | end
22 | end
23 | end
24 |
--------------------------------------------------------------------------------
/plugins/guests/netbsd/cap/rsync.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../synced_folders/rsync/default_unix_cap"
2 |
3 | module VagrantPlugins
4 | module GuestNetBSD
5 | module Cap
6 | class RSync
7 | extend VagrantPlugins::SyncedFolderRSync::DefaultUnixCap
8 |
9 | def self.rsync_install(machine)
10 | machine.communicate.sudo(
11 | 'PATH=$PATH:/usr/sbin '\
12 | 'PKG_PATH="http://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/' \
13 | '`uname -m`/`uname -r | cut -d. -f1-2`/All" ' \
14 | 'pkg_add rsync'
15 | )
16 | end
17 | end
18 | end
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/hosts/arch/cap/nfs.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module HostArch
3 | module Cap
4 | class NFS
5 | def self.nfs_check_command(env)
6 | return "/usr/sbin/systemctl status --no-pager nfs-server.service"
7 | end
8 |
9 | def self.nfs_start_command(env)
10 | return "/usr/sbin/systemctl start nfs-server.service"
11 | end
12 |
13 | def self.nfs_installed(environment)
14 | Kernel.system("systemctl --no-pager --no-legend --plain list-unit-files --all --type=service | grep --fixed-strings --quiet nfs-server.service")
15 | end
16 | end
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/test/unit/plugins/kernel_v2/config/ssh_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../../../../base", __FILE__)
2 |
3 | require Vagrant.source_root.join("plugins/kernel_v2/config/ssh")
4 |
5 | describe VagrantPlugins::Kernel_V2::SSHConfig do
6 | subject { described_class.new }
7 |
8 | describe "#default" do
9 | it "defaults to vagrant username" do
10 | subject.finalize!
11 | expect(subject.default.username).to eq("vagrant")
12 | end
13 | end
14 |
15 | describe "#sudo_command" do
16 | it "defaults properly" do
17 | subject.finalize!
18 | expect(subject.sudo_command).to eq("sudo -E -H %c")
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/test/unit/vagrant/action/builtin/env_set_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../../../../base", __FILE__)
2 |
3 | describe Vagrant::Action::Builtin::EnvSet do
4 | let(:app) { lambda { |env| } }
5 | let(:env) { {} }
6 |
7 | it "should set the new environment" do
8 | described_class.new(app, env, foo: :bar).call(env)
9 |
10 | expect(env[:foo]).to eq(:bar)
11 | end
12 |
13 | it "should call the next middleware" do
14 | callable = lambda { |env| env[:called] = env[:foo] }
15 |
16 | expect(env[:called]).to be_nil
17 | described_class.new(callable, env, foo: :yep).call(env)
18 | expect(env[:called]).to eq(:yep)
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/plugins/provisioners/docker/cap/linux/docker_configure_vagrant_user.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module DockerProvisioner
3 | module Cap
4 | module Linux
5 | module DockerConfigureVagrantUser
6 | def self.docker_configure_vagrant_user(machine)
7 | ssh_info = machine.ssh_info
8 |
9 | machine.communicate.tap do |comm|
10 | if comm.test("getent group docker") && !comm.test("id -Gn | grep docker")
11 | comm.sudo("usermod -a -G docker #{ssh_info[:username]}")
12 | end
13 | end
14 | end
15 | end
16 | end
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/plugins/provisioners/docker/cap/debian/docker_install.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module DockerProvisioner
3 | module Cap
4 | module Debian
5 | module DockerInstall
6 | def self.docker_install(machine)
7 | machine.communicate.tap do |comm|
8 | comm.sudo("apt-get update -qq -y")
9 | comm.sudo("apt-get install -qq -y --force-yes curl apt-transport-https")
10 | comm.sudo("apt-get purge -qq -y lxc-docker* || true")
11 | comm.sudo("curl -sSL https://get.docker.com/ | sh")
12 | end
13 | end
14 | end
15 | end
16 | end
17 | end
18 | end
19 |
--------------------------------------------------------------------------------
/test/unit/plugins/guests/pld/cap/network_scripts_dir_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../../base"
2 |
3 | describe "VagrantPlugins::GuestPld::Cap::NetworkScriptsDir" do
4 | let(:caps) do
5 | VagrantPlugins::GuestPld::Plugin
6 | .components
7 | .guest_capabilities[:pld]
8 | end
9 |
10 | let(:machine) { double("machine") }
11 |
12 | describe ".network_scripts_dir" do
13 | let(:cap) { caps.get(:network_scripts_dir) }
14 |
15 | let(:name) { "banana-rama.example.com" }
16 |
17 | it "is /etc/sysconfig/interfaces" do
18 | expect(cap.network_scripts_dir(machine)).to eq("/etc/sysconfig/interfaces")
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/plugins/provisioners/chef/cap/debian/chef_install.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../omnibus"
2 |
3 | module VagrantPlugins
4 | module Chef
5 | module Cap
6 | module Debian
7 | module ChefInstall
8 | def self.chef_install(machine, project, version, channel, omnibus_url, options = {})
9 | machine.communicate.sudo("apt-get update -y -qq")
10 | machine.communicate.sudo("apt-get install -y -qq curl")
11 |
12 | command = Omnibus.sh_command(project, version, channel, omnibus_url, options)
13 | machine.communicate.sudo(command)
14 | end
15 | end
16 | end
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/plugins/guests/redhat/cap/flavor.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestRedHat
3 | module Cap
4 | class Flavor
5 | def self.flavor(machine)
6 | # Read the version file
7 | output = ""
8 | machine.communicate.sudo("cat /etc/redhat-release") do |_, data|
9 | output = data
10 | end
11 |
12 | # Detect various flavors we care about
13 | if output =~ /(CentOS|Red Hat Enterprise|Scientific|Cloud|Virtuozzo)\s*Linux( .+)? release 7/i
14 | return :rhel_7
15 | else
16 | return :rhel
17 | end
18 | end
19 | end
20 | end
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/plugins/provisioners/ansible/cap/guest/suse/ansible_install.rb:
--------------------------------------------------------------------------------
1 |
2 | module VagrantPlugins
3 | module Ansible
4 | module Cap
5 | module Guest
6 | module SUSE
7 | module AnsibleInstall
8 |
9 | def self.ansible_install(machine, install_mode, ansible_version, pip_args)
10 | if install_mode != :default
11 | raise Ansible::Errors::AnsiblePipInstallIsNotSupported
12 | else
13 | machine.communicate.sudo("zypper --non-interactive --quiet install ansible")
14 | end
15 | end
16 |
17 | end
18 | end
19 | end
20 | end
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/test/unit/vagrant/plugin/v2/components_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../../../../base", __FILE__)
2 |
3 | require "vagrant/registry"
4 |
5 | describe Vagrant::Plugin::V2::Components do
6 | subject { described_class.new }
7 |
8 | it "should have synced folders" do
9 | expect(subject.synced_folders).to be_kind_of(Vagrant::Registry)
10 | end
11 |
12 | describe "configs" do
13 | it "should have configs" do
14 | expect(subject.configs).to be_kind_of(Hash)
15 | end
16 |
17 | it "should default the values to registries" do
18 | expect(subject.configs[:i_probably_dont_exist]).to be_kind_of(Vagrant::Registry)
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/plugins/guests/bsd/cap/virtualbox.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestBSD
3 | module Cap
4 | class VirtualBox
5 | # BSD-based guests do not currently support VirtualBox synced folders.
6 | # Instead of raising an error about a missing capability, this defines
7 | # the capability and then provides a more detailed error message,
8 | # linking to sources on the Internet where the problem is
9 | # better-described.
10 | def self.mount_virtualbox_shared_folder(machine, name, guestpath, options)
11 | raise Vagrant::Errors::VirtualBoxMountNotSupportedBSD
12 | end
13 | end
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/test/acceptance/provider-virtualbox/network_intnet_spec.rb:
--------------------------------------------------------------------------------
1 | shared_examples "provider/network/intnet" do |provider, options|
2 | if !options[:box]
3 | raise ArgumentError,
4 | "box option must be specified for provider: #{provider}"
5 | end
6 |
7 | include_context "acceptance"
8 |
9 | before do
10 | environment.skeleton("network_intnet")
11 | assert_execute("vagrant", "box", "add", "box", options[:box])
12 | assert_execute("vagrant", "up", "--provider=#{provider}")
13 | end
14 |
15 | after do
16 | assert_execute("vagrant", "destroy", "--force", log: false)
17 | end
18 |
19 | it "properly configures an internal network" do
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/website/source/docs/cli/ssh_config.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: "docs"
3 | page_title: "vagrant ssh-config - Command-Line Interface"
4 | sidebar_current: "cli-ssh_config"
5 | description: |-
6 | The "vagrant ssh-config" command is used to output a valid SSH configuration
7 | file capable of SSHing into the guest machine directly.
8 | ---
9 |
10 | # SSH Config
11 |
12 | **Command: `vagrant ssh-config [name|id]`**
13 |
14 | This will output valid configuration for an SSH config file to SSH
15 | into the running Vagrant machine from `ssh` directly (instead of
16 | using `vagrant ssh`).
17 |
18 | ## Options
19 |
20 | * `--host NAME` - Name of the host for the outputted configuration.
21 |
--------------------------------------------------------------------------------
/lib/vagrant/action/builtin/message.rb:
--------------------------------------------------------------------------------
1 | module Vagrant
2 | module Action
3 | module Builtin
4 | # This middleware simply outputs a message to the UI.
5 | class Message
6 | def initialize(app, env, message, **opts)
7 | @app = app
8 | @message = message
9 | @opts = opts
10 | end
11 |
12 | def call(env)
13 | if !@opts[:post]
14 | env[:ui].output(@message)
15 | end
16 |
17 | @app.call(env)
18 |
19 | if @opts[:post]
20 | env[:ui].output(@message)
21 | end
22 | end
23 | end
24 | end
25 | end
26 | end
27 |
--------------------------------------------------------------------------------
/plugins/commands/plugin/command/base.rb:
--------------------------------------------------------------------------------
1 | require "vagrant/plugin/state_file"
2 |
3 | module VagrantPlugins
4 | module CommandPlugin
5 | module Command
6 | class Base < Vagrant.plugin("2", :command)
7 | # This is a helper for executing an action sequence with the proper
8 | # environment hash setup so that the plugin specific helpers are
9 | # in.
10 | #
11 | # @param [Object] callable the Middleware callable
12 | # @param [Hash] env Extra environment hash that is merged in.
13 | def action(callable, env=nil)
14 | @env.action_runner.run(callable, env)
15 | end
16 | end
17 | end
18 | end
19 | end
20 |
--------------------------------------------------------------------------------
/plugins/commands/port/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module CommandPort
5 | class Plugin < Vagrant.plugin("2")
6 | name "port command"
7 | description <<-DESC
8 | The `port` command displays guest port mappings.
9 | DESC
10 |
11 | command("port") do
12 | require_relative "command"
13 | self.init!
14 | Command
15 | end
16 |
17 | protected
18 |
19 | def self.init!
20 | return if defined?(@_init)
21 | I18n.load_path << File.expand_path("../locales/en.yml", __FILE__)
22 | I18n.reload!
23 | @_init = true
24 | end
25 | end
26 | end
27 | end
28 |
--------------------------------------------------------------------------------
/plugins/guests/windows/errors.rb:
--------------------------------------------------------------------------------
1 | module VagrantPlugins
2 | module GuestWindows
3 | module Errors
4 | # A convenient superclass for all our errors.
5 | class WindowsError < Vagrant::Errors::VagrantError
6 | error_namespace("vagrant_windows.errors")
7 | end
8 |
9 | class NetworkWinRMRequired < WindowsError
10 | error_key(:network_winrm_required)
11 | end
12 |
13 | class RenameComputerFailed < WindowsError
14 | error_key(:rename_computer_failed)
15 | end
16 |
17 | class PublicKeyDirectoryFailure < WindowsError
18 | error_key(:public_key_directory_failure)
19 | end
20 | end
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/test/unit/plugins/guests/redhat/cap/network_scripts_dir_test.rb:
--------------------------------------------------------------------------------
1 | require_relative "../../../../base"
2 |
3 | describe "VagrantPlugins::GuestRedHat::Cap::NetworkScriptsDir" do
4 | let(:caps) do
5 | VagrantPlugins::GuestRedHat::Plugin
6 | .components
7 | .guest_capabilities[:redhat]
8 | end
9 |
10 | let(:machine) { double("machine") }
11 |
12 | describe ".network_scripts_dir" do
13 | let(:cap) { caps.get(:network_scripts_dir) }
14 |
15 | let(:name) { "banana-rama.example.com" }
16 |
17 | it "is /etc/sysconfig/network-scripts" do
18 | expect(cap.network_scripts_dir(machine)).to eq("/etc/sysconfig/network-scripts")
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/test/unit/vagrant/config/v2/util_test.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path("../../../../base", __FILE__)
2 |
3 | require "vagrant/config/v2/util"
4 |
5 | describe Vagrant::Config::V2::Util do
6 | describe "merging errors" do
7 | it "should merge matching keys and leave the rest alone" do
8 | first = { "one" => ["foo"], "two" => ["two"] }
9 | second = { "one" => ["bar"], "three" => ["three"] }
10 |
11 | expected = {
12 | "one" => ["foo", "bar"],
13 | "two" => ["two"],
14 | "three" => ["three"]
15 | }
16 |
17 | result = described_class.merge_errors(first, second)
18 | expect(result).to eq(expected)
19 | end
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/website/source/docs/cli/status.html.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: "docs"
3 | page_title: "vagrant status - Command-Line Interface"
4 | sidebar_current: "cli-status"
5 | description: |-
6 | The "vagrant status" command is used to tell you the status of the virtual
7 | machines in the current Vagrant environment.
8 | ---
9 |
10 | # Status
11 |
12 | **Command: `vagrant status [name|id]`**
13 |
14 | This will tell you the state of the machines Vagrant is managing.
15 |
16 | It is quite easy, especially once you get comfortable with Vagrant, to
17 | forget whether your Vagrant machine is running, suspended, not created, etc.
18 | This command tells you the state of the underlying guest machine.
19 |
--------------------------------------------------------------------------------
/plugins/guests/atomic/plugin.rb:
--------------------------------------------------------------------------------
1 | require "vagrant"
2 |
3 | module VagrantPlugins
4 | module GuestAtomic
5 | class Plugin < Vagrant.plugin("2")
6 | name "Atomic Host guest"
7 | description "Atomic Host guest support."
8 |
9 | guest(:atomic, :fedora) do
10 | require_relative "guest"
11 | Guest
12 | end
13 |
14 | guest_capability(:atomic, :change_host_name) do
15 | require_relative "cap/change_host_name"
16 | Cap::ChangeHostName
17 | end
18 |
19 | guest_capability(:atomic, :docker_daemon_running) do
20 | require_relative "cap/docker"
21 | Cap::Docker
22 | end
23 | end
24 | end
25 | end
26 |
--------------------------------------------------------------------------------