vagrant

HashiCorp Vagrant 2.0.2.

We are pleased to announce the release of HashiCorp Vagrant 2.0.2. Vagrant is a tool for building and distributing development environments. The highlight of this release is an updated implementation of SMB synced folders with added host support for macOS.

Download Now

Notable new features included within this release:

»SMB synced folders

Vagrant 2.0.2 includes an updated implementation of SMB synced folders. For users with Windows hosts this updated implementation includes:

  • Automatic host removal of SMB shares on destroy
  • Credential validation during share setup
  • Prevention of credentials display within Vagrant output
  • Removal of administrator privileged console requirement
  • Support for mount option overrides within guests

For users with macOS hosts, this release introduces SMB synced folder support.

»Sensitive values and Vagrant output

A new feature within the Vagrant 2.0.2 release is the ability to scrub sensitive values from Vagrant's output. This is especially useful when environment variables used within provisioners may contain passwords or API keys. Once values have been registered as sensitive, Vagrant will mask the value in normal output as well as the logger output. This feature can be enabled on shell provisioners by setting the sensitive option:

Vagrant.configure("2") do |config|
  ...
  config.vm.provision :shell,
    path: "./scripts/provision.sh",
    sensitive: true,
    env: {
      "SERVICE_USERNAME" => ENV["SERVICE_USERNAME"],
      "SERVICE_PASSWORD" => ENV["SERVICE_PASSWORD"]
    }
end

Sensitive values can also be manually configured within the Vagrantfile directly. This allows registering arbitrary values as sensitive to prevent Vagrant from displaying them within the output:

Vagrant.configure("2") do |config|
  config.vagrant.sensitive = [
    "MySecretPassword",
    "RemoveServiceApiKey"
  ]
end

##Customized Vagrant Templates The Vagrantfile generated by the vagrant init command can now be customized using the --template option. Templates are defined in ERB format and are provided the values given to the command by the user. Below is a simple example of a Vagrantfile template:

# ./templates/custom.erb
Vagrantfile.configure("2") do |config|
  config.vm.box = "<%= @box_name %>"
  <% if !@box_version.to_s.empty? %>
  config.vm.box_version = "<%= @box_version %>"
  <% end %>
  # This is a customized template, just for you!
end

and can be used by running:

vagrant init custom/box-name --template ./templates/custom.erb

»Other improvements

The Vagrant 2.0.2 release includes a number of other improvements and bug fixes. For a detailed list of all the changes in this release, see the CHANGELOG.


Sign up for the latest HashiCorp news

By submitting this form, you acknowledge and agree that HashiCorp will process your personal information in accordance with the Privacy Policy.