Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Vagrant includes for nodes and local
Note: relative paths should always use VAGRANT_HOME fixes #155
- Loading branch information
1 parent
1c6681e
commit e6e96ae
Showing
7 changed files
with
50 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
raise "VAGRANT_HOME needs to be defined prior vagrant_helper!" unless defined? VAGRANT_HOME | ||
|
||
VAGRANTFILE_API_VERSION = "2" unless defined? VAGRANTFILE_API_VERSION | ||
VAGRANT_REQUIRED_VERSION = "1.8.0" unless defined? VAGRANT_REQUIRED_VERSION | ||
VAGRANT_REQUIRED_LINKED_CLONE_VERSION = "1.8.4" unless defined? VAGRANT_REQUIRED_LINKED_CLONE_VERSION | ||
|
||
# Require 1.6.5 at least | ||
if ! defined? Vagrant.require_version | ||
if Gem::Version.new(Vagrant::VERSION) < Gem::Version.new(VAGRANT_REQUIRED_VERSION) | ||
puts "Vagrant >= " + VAGRANT_REQUIRED_VERSION + " required. Your version is " + Vagrant::VERSION | ||
exit 1 | ||
end | ||
else | ||
Vagrant.require_version ">= " + VAGRANT_REQUIRED_VERSION | ||
end | ||
|
||
nodesFile = VAGRANT_HOME + "/Vagrantfile.nodes" | ||
localFile = VAGRANT_HOME + "/Vagrantfile.local" | ||
nodes = {} | ||
|
||
raise "ERROR: Vagrantfile.nodes is missing from source tree." unless File.exists?(nodesFile) | ||
|
||
eval(IO.read(nodesFile), binding) | ||
|
||
# allow to override the configuration | ||
eval(IO.read(localFile), binding) if File.exists?(localFile) | ||
|
||
# Export nodes to global scope | ||
$nodes = nodes |