From b24e69eb605dde22a7325ab01b0c0586cca432da Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Tue, 2 Feb 2016 09:43:28 -0500 Subject: [PATCH] Always use a string for Vagrantfile version --- templates/commands/init/Vagrantfile.erb | 2 +- templates/commands/init/Vagrantfile.min.erb | 2 +- test/unit/plugins/pushes/atlas/push_test.rb | 2 +- test/unit/vagrant/config_test.rb | 2 +- website/Vagrantfile | 2 +- website/source/docs/provisioning/ansible.html.md | 2 +- website/source/docs/provisioning/ansible_intro.html.md | 8 ++++---- website/source/docs/provisioning/ansible_local.html.md | 4 ++-- website/source/docs/vagrantfile/tips.html.md | 2 +- website/source/docs/vagrantfile/version.html.md | 2 +- website/source/docs/vmware/kernel-upgrade.html.md | 2 +- website/source/docs/vmware/usage.html.md | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/templates/commands/init/Vagrantfile.erb b/templates/commands/init/Vagrantfile.erb index 4cae3c990..e9712be52 100644 --- a/templates/commands/init/Vagrantfile.erb +++ b/templates/commands/init/Vagrantfile.erb @@ -5,7 +5,7 @@ # configures the configuration version (we support older styles for # backwards compatibility). Please don't change it unless you know what # you're doing. -Vagrant.configure(2) do |config| +Vagrant.configure("2") do |config| # The most common configuration options are documented and commented below. # For a complete reference, please see the online documentation at # https://docs.vagrantup.com. diff --git a/templates/commands/init/Vagrantfile.min.erb b/templates/commands/init/Vagrantfile.min.erb index ac70f5e7c..cfb42fb84 100644 --- a/templates/commands/init/Vagrantfile.min.erb +++ b/templates/commands/init/Vagrantfile.min.erb @@ -1,4 +1,4 @@ -Vagrant.configure(2) do |config| +Vagrant.configure("2") do |config| config.vm.box = "<%= box_name %>" <% if box_url -%> config.vm.box_url = "<%= box_url %>" diff --git a/test/unit/plugins/pushes/atlas/push_test.rb b/test/unit/plugins/pushes/atlas/push_test.rb index 72eb46057..974df36a8 100644 --- a/test/unit/plugins/pushes/atlas/push_test.rb +++ b/test/unit/plugins/pushes/atlas/push_test.rb @@ -104,7 +104,7 @@ describe VagrantPlugins::AtlasPush::Push do let(:env) do iso_env = isolated_environment iso_env.vagrantfile <<-EOH - Vagrant.configure(2) do |config| + Vagrant.configure("2") do |config| config.vm.box = "hashicorp/precise64" config.vm.box_url = "https://atlas.hashicorp.com/hashicorp/precise64" end diff --git a/test/unit/vagrant/config_test.rb b/test/unit/vagrant/config_test.rb index 5f05828cb..8e7819367 100644 --- a/test/unit/vagrant/config_test.rb +++ b/test/unit/vagrant/config_test.rb @@ -40,7 +40,7 @@ describe Vagrant::Config do receiver.one end - Vagrant.configure(2) do + Vagrant.configure("2") do receiver.two end end diff --git a/website/Vagrantfile b/website/Vagrantfile index cb40d506b..805e01734 100644 --- a/website/Vagrantfile +++ b/website/Vagrantfile @@ -12,7 +12,7 @@ sudo su -l -c 'gem install bundler' vagrant sudo su -l -c 'cd /vagrant && bundle install --jobs 2' vagrant SCRIPT -Vagrant.configure(2) do |config| +Vagrant.configure("2") do |config| config.vm.box = "hashicorp/precise64" config.vm.network "private_network", ip: "33.33.33.10" config.vm.provision "shell", inline: $script, privileged: false diff --git a/website/source/docs/provisioning/ansible.html.md b/website/source/docs/provisioning/ansible.html.md index eb8b5eca9..7d87dffe9 100644 --- a/website/source/docs/provisioning/ansible.html.md +++ b/website/source/docs/provisioning/ansible.html.md @@ -37,7 +37,7 @@ This page only documents the specific parts of the `ansible` (remote) provisione To run Ansible against your Vagrant guest, the basic `Vagrantfile` configuration looks like: ```ruby -Vagrant.configure(2) do |config| +Vagrant.configure("2") do |config| # # Run Ansible from the Vagrant Host diff --git a/website/source/docs/provisioning/ansible_intro.html.md b/website/source/docs/provisioning/ansible_intro.html.md index 9584fcf59..d351ddb65 100644 --- a/website/source/docs/provisioning/ansible_intro.html.md +++ b/website/source/docs/provisioning/ansible_intro.html.md @@ -48,7 +48,7 @@ You can of course target other operating systems that do not have YUM by changin The `playbook` option is strictly required by both Ansible provisioners ([`ansible`](/docs/provisioning/ansible.html) and [`ansible_local`](/docs/provisioning/ansible_local.html)), as illustrated in this basic Vagrantfile` configuration: ```ruby -Vagrant.configure(2) do |config| +Vagrant.configure("2") do |config| # Use :ansible or :ansible_local to # select the provisioner of your choice @@ -75,7 +75,7 @@ Since an Ansible playbook can include many files, you may also collect the relat In such an arrangement, the `ansible.playbook` path should be adjusted accordingly: ```ruby -Vagrant.configure(2) do |config| +Vagrant.configure("2") do |config| config.vm.provision "ansible" do |ansible| ansible.playbook = "provisioning/playbook.yml" end @@ -116,7 +116,7 @@ Note that the generated inventory file is uploaded to the guest VM in a subdirec As of Vagrant 1.8.0, the [`host_vars`](/docs/provisioning/ansible_common.html) option can be used to set [variables for individual hosts](https://docs.ansible.com/ansible/intro_inventory.html#host-variables) in the generated inventory file (see also the notes on group variables below). ``` -Vagrant.configure(2) do |config| +Vagrant.configure("2") do |config| config.vm.define "host1" config.vm.define "host2" config.vm.provision "ansible" do |ansible| @@ -149,7 +149,7 @@ As of Vagrant 1.8.0, it is also possible to specify [group variables](https://do With this configuration example: ``` -Vagrant.configure(2) do |config| +Vagrant.configure("2") do |config| config.vm.box = "ubuntu/trusty64" diff --git a/website/source/docs/provisioning/ansible_local.html.md b/website/source/docs/provisioning/ansible_local.html.md index fe43db2ca..4d34f20e0 100644 --- a/website/source/docs/provisioning/ansible_local.html.md +++ b/website/source/docs/provisioning/ansible_local.html.md @@ -39,7 +39,7 @@ The Ansible Local provisioner requires that all the Ansible Playbook files are a To run Ansible from your Vagrant guest, the basic `Vagrantfile` configuration looks like: ```ruby -Vagrant.configure(2) do |config| +Vagrant.configure("2") do |config| # Run Ansible from the Vagrant VM config.vm.provision "ansible_local" do |ansible| ansible.playbook = "playbook.yml" @@ -96,7 +96,7 @@ This section lists the specific options for the Ansible Local provisioner. In ad With the following configuration pattern, you can install and execute Ansible only on a single guest machine (the `"controller"`) to provision all your machines. ```ruby -Vagrant.configure(2) do |config| +Vagrant.configure("2") do |config| config.vm.box = "ubuntu/trusty64" diff --git a/website/source/docs/vagrantfile/tips.html.md b/website/source/docs/vagrantfile/tips.html.md index 320d0632b..8064b13f3 100644 --- a/website/source/docs/vagrantfile/tips.html.md +++ b/website/source/docs/vagrantfile/tips.html.md @@ -64,7 +64,7 @@ is override locale in the `Vagrantfile`: ```ruby ENV["LC_ALL"] = "en_US.UTF-8" -Vagrant.configure(2) do |config| +Vagrant.configure("2") do |config| # ... end ``` diff --git a/website/source/docs/vagrantfile/version.html.md b/website/source/docs/vagrantfile/version.html.md index 21a189a9f..14897dc30 100644 --- a/website/source/docs/vagrantfile/version.html.md +++ b/website/source/docs/vagrantfile/version.html.md @@ -19,7 +19,7 @@ If you run `vagrant init` today, the Vagrantfile will be in roughly the following format: ```ruby -Vagrant.configure(2) do |config| +Vagrant.configure("2") do |config| # ... end ``` diff --git a/website/source/docs/vmware/kernel-upgrade.html.md b/website/source/docs/vmware/kernel-upgrade.html.md index 7fe779b45..96e1bd775 100644 --- a/website/source/docs/vmware/kernel-upgrade.html.md +++ b/website/source/docs/vmware/kernel-upgrade.html.md @@ -34,7 +34,7 @@ sed -i.bak 's/answer AUTO_KMODS_ENABLED_ANSWER no/answer AUTO_KMODS_ENABLED_ANSW sed -i 's/answer AUTO_KMODS_ENABLED no/answer AUTO_KMODS_ENABLED yes/g' /etc/vmware-tools/locations SCRIPT -Vagrant.configure(2) do |config| +Vagrant.configure("2") do |config| # ... config.vm.provision "shell", inline: $fix_vmware_tools_script diff --git a/website/source/docs/vmware/usage.html.md b/website/source/docs/vmware/usage.html.md index 82d7414a5..5ede22e82 100644 --- a/website/source/docs/vmware/usage.html.md +++ b/website/source/docs/vmware/usage.html.md @@ -23,7 +23,7 @@ To get started, create a new `Vagrantfile` that points to a VMware box: ```ruby # vagrant init hashicorp/precise64 -Vagrant.configure(2) do |config| +Vagrant.configure("2") do |config| config.vm.box = "hashicorp/precise64" end ```