Created
February 4, 2019 18:54
-
-
Save timo002/fa348da8f862e683492f097f6048e834 to your computer and use it in GitHub Desktop.
Vagrantfile
This file contains hidden or 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
# -*- mode: ruby -*- | |
dir = File.dirname(File.expand_path(__FILE__)) | |
require 'yaml' | |
require "#{dir}/puphpet/ruby/deep_merge.rb" | |
require "#{dir}/puphpet/ruby/to_bool.rb" | |
configValues = YAML.load_file("#{dir}/puphpet/config.yaml") | |
provider = ENV['VAGRANT_DEFAULT_PROVIDER'] ? ENV['VAGRANT_DEFAULT_PROVIDER'] : 'local' | |
if File.file?("#{dir}/puphpet/config-#{provider}.yaml") | |
custom = YAML.load_file("#{dir}/puphpet/config-#{provider}.yaml") | |
configValues.deep_merge!(custom) | |
end | |
if File.file?("#{dir}/puphpet/config-custom.yaml") | |
custom = YAML.load_file("#{dir}/puphpet/config-custom.yaml") | |
configValues.deep_merge!(custom) | |
end | |
data = configValues['vagrantfile'] | |
Vagrant.require_version '>= 1.8.1' | |
Vagrant.configure('2') do |config| | |
eval File.read("#{dir}/puphpet/vagrant/Vagrantfile-#{data['target']}") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment