Vagrant Concepts: Difference between revisions
(30 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
* [[Vagrant#Concepts|Vagrant]] | * [[Vagrant#Concepts|Vagrant]] | ||
=State= | |||
==Global State== | |||
Vagrant maintains state corresponding to all its resources managed for a specific user in <code>~/.vagrant.d</code>: | |||
* [[#Plugin_State|plugin global state]], including the plugin list and plugin code. | |||
* [[#Box_State|box metadata]]. | |||
The <code>~/.vagrant.d</code> and its initial sub-directories are automatically created first time vagrant is used in the user's account. | |||
=Environment= | =Environment= | ||
An environment is identified by an ID. It has a name, a provider, and | A Vagrant environment is a directory with a [[Vagrantfile]] in it. An environment is identified by an ID. It has a name, a provider, and its associated directory, and at any moment is in a specific state (for example, "running"). The details of all environments for the logged in user is given by the [[Vagrant Environment Operations#global-status|vagrant global-status]] command. | ||
The environment ID can be used to control the machine from anywhere on the system. | The environment ID can be used to control the machine from anywhere on the system, by [[Vagrant_Instance_Operations#Instance_Operations|any command that takes a target machine]]. | ||
==Local Project== | |||
==Environment Operations== | ==Environment Operations== | ||
* [[Vagrant_Environment_Operations#init|Environment initialization]] | |||
* [[ | * [[Vagrant_Environment_Operations#global-status|Getting the status of all user's environments]] | ||
=Vagrantfile= | =Vagrantfile= | ||
{{Internal|Vagrantfile|Vagrantfile}} | {{Internal|Vagrantfile|Vagrantfile}} | ||
=Plugin= | |||
{{External|https://www.vagrantup.com/docs/plugins/}} | |||
A plugin extends Vagrant by adding new functionality such as new [[#Provider|providers]]. Plugins extend Vagrant using a stable API. Most of the core Vagrant functionality is implemented using [https://github.com/hashicorp/vagrant/tree/master/plugins core plugins]. Plugins are usually packages as [https://rubygems.org/ RubyGems]. | |||
==Plugin State== | |||
A plugin is installed by default globally for a user, meaning that its stored in user's [[#Global_State|global state]]. As such, plugin identifying information is registered in <code>~/.vagrant.d/plugins.json</code> and the code itself is stored in <code>~/.vagrant.d/gems</code>. | |||
== | ==Plugin Operations== | ||
* [[Vagrant Plugin Operations#list|Lists installed plugins]] | |||
=Box= | |||
{{ | {{External|https://www.vagrantup.com/docs/cli/box.html}} | ||
Vagrant boxes are prepackaged development environments that are the foundation of Vagrant. In most cases, this is usually just a stripped and naked operating system such as Ubuntu, Debian, or CentOS. Boxes exist with the intention to be provisioned with additional features like Apache and PHP using tools like Chef or Puppet. There are publicly available Vagrant boxes: https://www.vagrantup.com/docs/cli/box.html | |||
= | ==Box State== | ||
A box is installed by default globally for a user, meaning that its stored in user's [[#Global_State|global state]]. As such, box metadata is installed under <code>~/.vagrant.d/boxes</code>. | |||
==Dummy Box== | |||
== | ==Box Operations== | ||
* [[Vagrant_Box_Operations#list|Listing available boxes]] | |||
=Provider= | =Provider= | ||
Line 45: | Line 60: | ||
==AWS Provider== | ==AWS Provider== | ||
{{ | {{Internal|Vagrant AWS Provider|AWS Provider}} | ||
Latest revision as of 20:48, 17 November 2019
Internal
State
Global State
Vagrant maintains state corresponding to all its resources managed for a specific user in ~/.vagrant.d
:
- plugin global state, including the plugin list and plugin code.
- box metadata.
The ~/.vagrant.d
and its initial sub-directories are automatically created first time vagrant is used in the user's account.
Environment
A Vagrant environment is a directory with a Vagrantfile in it. An environment is identified by an ID. It has a name, a provider, and its associated directory, and at any moment is in a specific state (for example, "running"). The details of all environments for the logged in user is given by the vagrant global-status command.
The environment ID can be used to control the machine from anywhere on the system, by any command that takes a target machine.
Local Project
Environment Operations
Vagrantfile
Plugin
A plugin extends Vagrant by adding new functionality such as new providers. Plugins extend Vagrant using a stable API. Most of the core Vagrant functionality is implemented using core plugins. Plugins are usually packages as RubyGems.
Plugin State
A plugin is installed by default globally for a user, meaning that its stored in user's global state. As such, plugin identifying information is registered in ~/.vagrant.d/plugins.json
and the code itself is stored in ~/.vagrant.d/gems
.
Plugin Operations
Box
Vagrant boxes are prepackaged development environments that are the foundation of Vagrant. In most cases, this is usually just a stripped and naked operating system such as Ubuntu, Debian, or CentOS. Boxes exist with the intention to be provisioned with additional features like Apache and PHP using tools like Chef or Puppet. There are publicly available Vagrant boxes: https://www.vagrantup.com/docs/cli/box.html
Box State
A box is installed by default globally for a user, meaning that its stored in user's global state. As such, box metadata is installed under ~/.vagrant.d/boxes
.
Dummy Box
Box Operations
Provider
A provider is the functionality that allows Vagrant to support a specific type of VM. Vagrant ships out of the box with support for VirtualBox, HyperV and Docker. Support for other types of machines can be added via external providers, integrated with Vagrant via plugins. Examples of such providers are AWS provider.