vagrant-yarrs-and-yamls 0.8.3 → 0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/Gemfile +2 -0
- data/README.md +58 -11
- data/Yarrs.example.yaml +20 -0
- data/example.Vagrantfile +2 -8
- data/lib/scripts/apache2.sh +34 -0
- data/lib/scripts/apache2_ssl.sh +24 -0
- data/lib/scripts/base.sh +32 -0
- data/lib/scripts/composer.sh +28 -0
- data/lib/scripts/deploy.sh +38 -0
- data/lib/scripts/deploy_init.sh +11 -0
- data/lib/scripts/export_vars.sh +16 -0
- data/lib/scripts/git.sh +11 -0
- data/lib/scripts/hhvm.sh +33 -0
- data/lib/scripts/install-nodejs-modules.sh +19 -0
- data/lib/scripts/mariadb.sh +35 -0
- data/lib/scripts/mysql-create-databases.sh +19 -0
- data/lib/scripts/mysql.sh +28 -0
- data/lib/scripts/mysql_client.sh +22 -0
- data/lib/scripts/newrelic_php.sh +37 -0
- data/lib/scripts/nginx.sh +26 -0
- data/lib/scripts/nginx_site.sh +27 -0
- data/lib/scripts/nodejs.sh +24 -0
- data/lib/scripts/nvm.sh +30 -0
- data/lib/scripts/permissions.sh +18 -0
- data/lib/scripts/php.sh +25 -0
- data/lib/scripts/php_configure.sh +18 -0
- data/lib/scripts/php_xdebug.sh +18 -0
- data/lib/scripts/phpbrew.sh +11 -0
- data/lib/scripts/postfix.sh +13 -0
- data/lib/scripts/pubkeys.sh +35 -0
- data/lib/scripts/rvm.sh +35 -0
- data/lib/scripts/test.sh +48 -0
- data/lib/scripts/tz.sh +8 -0
- data/lib/scripts/wp_env.sh +16 -0
- data/lib/scripts/wpcli.sh +27 -0
- data/lib/templates/apache2.conf +151 -0
- data/lib/templates/apache2_vhost_http.conf +8 -0
- data/lib/templates/apache2_vhost_https.conf +16 -0
- data/lib/templates/apache2_vhost_redirect_http.conf +17 -0
- data/lib/templates/apache2_vhost_redirect_https.conf +18 -0
- data/lib/templates/gitconfig.conf +32 -0
- data/lib/templates/logrotate.conf +14 -0
- data/lib/templates/nginx.conf +56 -0
- data/lib/templates/nginx_vhost.erb +45 -0
- data/lib/templates/proxy_params.conf +3 -0
- data/lib/templates/xdebug.ini +6 -0
- data/lib/vagrant-yarrs-and-yamls/api.rb +423 -0
- data/lib/vagrant-yarrs-and-yamls/plugin.rb +4 -48
- data/lib/vagrant-yarrs-and-yamls/version.rb +1 -1
- data/vagrant-yarrs-and-yamls.gemspec +1 -1
- metadata +51 -8
- data/example.Vagrantfile.yml +0 -8
- data/lib/vagrant-yarrs-and-yamls/v1.rb +0 -234
@@ -1,6 +1,5 @@
|
|
1
1
|
require "vagrant"
|
2
|
-
|
3
|
-
require_relative "v1"
|
2
|
+
require_relative "api"
|
4
3
|
|
5
4
|
module VagrantPlugins
|
6
5
|
module YarrsAndYamls
|
@@ -10,13 +9,7 @@ module VagrantPlugins
|
|
10
9
|
@@config = false
|
11
10
|
|
12
11
|
action_hook(:init, :environment_unload) { maybe_create_yaml_file }
|
13
|
-
action_hook(:load_config, Plugin::ALL_ACTIONS) { load_config }
|
14
|
-
|
15
|
-
action_hook(:require_vagrant_plugins, :environment_load) {
|
16
|
-
if ! self.get_config.empty?
|
17
|
-
self.require_vagrant_plugins(self.get_config["required_plugins"]) if self.get_config["required_plugins"]
|
18
|
-
end
|
19
|
-
}
|
12
|
+
# action_hook(:load_config, Plugin::ALL_ACTIONS) { load_config }
|
20
13
|
|
21
14
|
def self.maybe_create_yaml_file
|
22
15
|
ARGV.each do |arg|
|
@@ -34,8 +27,8 @@ module VagrantPlugins
|
|
34
27
|
end
|
35
28
|
|
36
29
|
def self.create_yaml_file
|
37
|
-
source = __FILE__ + '/../../../example.
|
38
|
-
dest = Dir.pwd + '/
|
30
|
+
source = __FILE__ + '/../../../Yarrs.example.yaml'
|
31
|
+
dest = Dir.pwd + '/Yarrs.example.yaml'
|
39
32
|
self.copy_file source, dest
|
40
33
|
end
|
41
34
|
|
@@ -57,43 +50,6 @@ module VagrantPlugins
|
|
57
50
|
ext = File.extname(file)
|
58
51
|
File.join(dir, "#{base}.bak.#{time}#{ext}")
|
59
52
|
end
|
60
|
-
|
61
|
-
def self.load_config
|
62
|
-
|
63
|
-
return @@config if @@config
|
64
|
-
|
65
|
-
@@config = []
|
66
|
-
configfile = ''
|
67
|
-
|
68
|
-
# Try Vagrant.local.yml next
|
69
|
-
if File.exists? "Vagrantfile.local.yml"
|
70
|
-
configfile = "Vagrantfile.local.yml"
|
71
|
-
elsif File.exists? "Vagrantfile.yml"
|
72
|
-
configfile = "Vagrantfile.yml"
|
73
|
-
end
|
74
|
-
|
75
|
-
# pass in a configfile to load.
|
76
|
-
ARGV.each do |arg|
|
77
|
-
if arg.include?('--config=')
|
78
|
-
configfile = arg.gsub('--config=', '')
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
#puts "configfile: #{configfile}"
|
83
|
-
if File.exists? configfile
|
84
|
-
@@config = YAML.load_file(configfile);
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
|
-
def self.get_config
|
89
|
-
@@config
|
90
|
-
end
|
91
|
-
|
92
|
-
def self.require_vagrant_plugins(plugins)
|
93
|
-
plugins.each do |plugin|
|
94
|
-
system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
|
95
|
-
end
|
96
|
-
end
|
97
53
|
end
|
98
54
|
end
|
99
55
|
end
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["yarr@piratedunbar.com"]
|
11
11
|
spec.description = "Configure your Vagrantfile using YAML"
|
12
12
|
spec.summary = spec.description
|
13
|
-
spec.homepage = "https://github.com/ptahdunbar/
|
13
|
+
spec.homepage = "https://github.com/ptahdunbar/yarrs-and-yamls"
|
14
14
|
spec.license = "GPL v2+"
|
15
15
|
#spec.post_install_message = ""
|
16
16
|
|
metadata
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-yarrs-and-yamls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: !binary |-
|
5
|
+
MC45
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Pirate Dunbar
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
date: 2015-
|
12
|
+
date: 2015-09-20 00:00:00.000000000 Z
|
12
13
|
dependencies: []
|
13
14
|
description: Configure your Vagrantfile using YAML
|
14
15
|
email:
|
@@ -22,14 +23,56 @@ files:
|
|
22
23
|
- LICENSE.txt
|
23
24
|
- README.md
|
24
25
|
- Rakefile
|
26
|
+
- Yarrs.example.yaml
|
25
27
|
- example.Vagrantfile
|
26
|
-
-
|
28
|
+
- lib/scripts/apache2.sh
|
29
|
+
- lib/scripts/apache2_ssl.sh
|
30
|
+
- lib/scripts/base.sh
|
31
|
+
- lib/scripts/composer.sh
|
32
|
+
- lib/scripts/deploy.sh
|
33
|
+
- lib/scripts/deploy_init.sh
|
34
|
+
- lib/scripts/export_vars.sh
|
35
|
+
- lib/scripts/git.sh
|
36
|
+
- lib/scripts/hhvm.sh
|
37
|
+
- lib/scripts/install-nodejs-modules.sh
|
38
|
+
- lib/scripts/mariadb.sh
|
39
|
+
- lib/scripts/mysql-create-databases.sh
|
40
|
+
- lib/scripts/mysql.sh
|
41
|
+
- lib/scripts/mysql_client.sh
|
42
|
+
- lib/scripts/newrelic_php.sh
|
43
|
+
- lib/scripts/nginx.sh
|
44
|
+
- lib/scripts/nginx_site.sh
|
45
|
+
- lib/scripts/nodejs.sh
|
46
|
+
- lib/scripts/nvm.sh
|
47
|
+
- lib/scripts/permissions.sh
|
48
|
+
- lib/scripts/php.sh
|
49
|
+
- lib/scripts/php_configure.sh
|
50
|
+
- lib/scripts/php_xdebug.sh
|
51
|
+
- lib/scripts/phpbrew.sh
|
52
|
+
- lib/scripts/postfix.sh
|
53
|
+
- lib/scripts/pubkeys.sh
|
54
|
+
- lib/scripts/rvm.sh
|
55
|
+
- lib/scripts/test.sh
|
56
|
+
- lib/scripts/tz.sh
|
57
|
+
- lib/scripts/wp_env.sh
|
58
|
+
- lib/scripts/wpcli.sh
|
59
|
+
- lib/templates/apache2.conf
|
60
|
+
- lib/templates/apache2_vhost_http.conf
|
61
|
+
- lib/templates/apache2_vhost_https.conf
|
62
|
+
- lib/templates/apache2_vhost_redirect_http.conf
|
63
|
+
- lib/templates/apache2_vhost_redirect_https.conf
|
64
|
+
- lib/templates/gitconfig.conf
|
65
|
+
- lib/templates/logrotate.conf
|
66
|
+
- lib/templates/nginx.conf
|
67
|
+
- lib/templates/nginx_vhost.erb
|
68
|
+
- lib/templates/proxy_params.conf
|
69
|
+
- lib/templates/xdebug.ini
|
27
70
|
- lib/vagrant-yarrs-and-yamls.rb
|
71
|
+
- lib/vagrant-yarrs-and-yamls/api.rb
|
28
72
|
- lib/vagrant-yarrs-and-yamls/plugin.rb
|
29
|
-
- lib/vagrant-yarrs-and-yamls/v1.rb
|
30
73
|
- lib/vagrant-yarrs-and-yamls/version.rb
|
31
74
|
- vagrant-yarrs-and-yamls.gemspec
|
32
|
-
homepage: https://github.com/ptahdunbar/
|
75
|
+
homepage: https://github.com/ptahdunbar/yarrs-and-yamls
|
33
76
|
licenses:
|
34
77
|
- GPL v2+
|
35
78
|
metadata: {}
|
@@ -39,17 +82,17 @@ require_paths:
|
|
39
82
|
- lib
|
40
83
|
required_ruby_version: !ruby/object:Gem::Requirement
|
41
84
|
requirements:
|
42
|
-
- - '>='
|
85
|
+
- - ! '>='
|
43
86
|
- !ruby/object:Gem::Version
|
44
87
|
version: '0'
|
45
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
89
|
requirements:
|
47
|
-
- - '>='
|
90
|
+
- - ! '>='
|
48
91
|
- !ruby/object:Gem::Version
|
49
92
|
version: '0'
|
50
93
|
requirements: []
|
51
94
|
rubyforge_project:
|
52
|
-
rubygems_version: 2.
|
95
|
+
rubygems_version: 2.4.8
|
53
96
|
signing_key:
|
54
97
|
specification_version: 4
|
55
98
|
summary: Configure your Vagrantfile using YAML
|
data/example.Vagrantfile.yml
DELETED
@@ -1,234 +0,0 @@
|
|
1
|
-
|
2
|
-
def yarrs_and_yamls(config=nil)
|
3
|
-
raise 'Missing required parameter. yarrs_and_yamls(config)' if ! config
|
4
|
-
|
5
|
-
vfile = VagrantPlugins::YarrsAndYamls::Plugin.get_config
|
6
|
-
|
7
|
-
boxes = get_nodes(vfile)
|
8
|
-
|
9
|
-
boxes.each do |hostname, box|
|
10
|
-
config.vm.define hostname do |node|
|
11
|
-
node.vm.box = box["box"]
|
12
|
-
node.vm.box_url = box["box_url"]
|
13
|
-
node.vm.box_check_update = box["box_check_update"]
|
14
|
-
node.vm.boot_timeout = box["boot_timeout"]
|
15
|
-
node.vm.box_download_checksum = box["box_download_checksum"]
|
16
|
-
node.vm.box_download_checksum_type = box["box_download_checksum_type"]
|
17
|
-
node.vm.box_download_client_cert = box["box_download_client_cert"]
|
18
|
-
node.vm.box_download_ca_cert = box["box_download_ca_cert"]
|
19
|
-
node.vm.box_download_ca_path = box["box_download_ca_path"]
|
20
|
-
node.vm.box_download_insecure = box["box_download_insecure"]
|
21
|
-
node.vm.box_version = box["box_version"]
|
22
|
-
node.vm.communicator = box["communicator"]
|
23
|
-
node.vm.graceful_halt_timeout = box["graceful_halt_timeout"]
|
24
|
-
node.vm.guest = box["guest"]
|
25
|
-
node.vm.post_up_message = box["post_up_message"]
|
26
|
-
node.vm.usable_port_range = box["usable_port_range"]
|
27
|
-
|
28
|
-
node.vm.network "private_network", ip: box["ip"], :netmask => "255.255.255.0" if box["ip"]
|
29
|
-
|
30
|
-
if box["forwarded_ports"]
|
31
|
-
box["forwarded_ports"].each do |port|
|
32
|
-
node.vm.network "forwarded_port", guest: port["guest"], host: port["host"]
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
if box["synced_folders"]
|
37
|
-
box["synced_folders"].each do |folder|
|
38
|
-
node.vm.synced_folder folder[:host], folder[:guest], folder[:args]
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
if box["ssh"]
|
43
|
-
node.ssh.username = box["ssh"]["username"] if box["ssh"]["username"]
|
44
|
-
node.ssh.password = box["ssh"]["password"] if box["ssh"]["password"]
|
45
|
-
node.ssh.host = box["ssh"]["host"] if box["ssh"]["host"]
|
46
|
-
node.ssh.port = box["ssh"]["port"] if box["ssh"]["port"]
|
47
|
-
node.ssh.guest_port = box["ssh"]["guest_port"] if box["ssh"]["guest_port"]
|
48
|
-
node.ssh.private_key_path = box["ssh"]["private_key_path"] if box["ssh"]["private_key_path"]
|
49
|
-
node.ssh.forward_agent = box["ssh"]["forward_agent"] if box["ssh"]["forward_agent"]
|
50
|
-
node.ssh.forward_x11 = box["ssh"]["forward_x11"] if box["ssh"]["forward_x11"]
|
51
|
-
node.ssh.insert_key = box["ssh"]["insert_key"] if box["ssh"]["insert_key"]
|
52
|
-
node.ssh.proxy_command = box["ssh"]["proxy_command"] if box["ssh"]["proxy_command"]
|
53
|
-
node.ssh.pty = box["ssh"]["pty"] if box["ssh"]["pty"]
|
54
|
-
node.ssh.shell = box["ssh"]["shell"] if box["ssh"]["shell"]
|
55
|
-
end
|
56
|
-
|
57
|
-
if box["provision"]
|
58
|
-
box["provision"].each do |script|
|
59
|
-
node.vm.provision "shell" do |s|
|
60
|
-
s.inline = script["inline"] if script["inline"]
|
61
|
-
s.path = script["path"] if script["path"]
|
62
|
-
s.args = script["args"] if script["args"]
|
63
|
-
s.privileged = script["privileged"] if script["privileged"]
|
64
|
-
s.binary = script["binary"] if script["binary"]
|
65
|
-
s.upload_path = script["upload_path"] if script["upload_path"]
|
66
|
-
s.keep_color = script["keep_color"] if script["keep_color"]
|
67
|
-
s.powershell_args = script["powershell_args"] if script["powershell_args"]
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
node.vm.provider :virtualbox do |virtualbox, override|
|
73
|
-
virtualbox.gui = true if box["gui"]
|
74
|
-
virtualbox.cpus = box["cpus"] if box["cpus"]
|
75
|
-
virtualbox.memory = box["memory"] if box["memory"]
|
76
|
-
end
|
77
|
-
|
78
|
-
node.vm.provider :vmware_fusion do |vmware, override|
|
79
|
-
override.vm.node_url = "http://files.vagrantup.com/precise64_vmware.node"
|
80
|
-
vmware.gui = true if box["gui"]
|
81
|
-
vmware.vmx["numvcpus"] = box["cpus"] if box["cpus"]
|
82
|
-
vmware.vmx["memsize"] = box["cpus"] if box["memory"]
|
83
|
-
end
|
84
|
-
|
85
|
-
node.vm.provider :aws do |aws, override|
|
86
|
-
if box["aws"]
|
87
|
-
override.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
|
88
|
-
|
89
|
-
# Required parameters
|
90
|
-
aws.ami = box["aws"]["ami"] if box["aws"]["ami"]
|
91
|
-
aws.instance_type = box["aws"]["instance_type"] if box["aws"]["instance_type"]
|
92
|
-
aws.keypair_name = box["aws"]["keypair_name"] if box["aws"]["keypair_name"]
|
93
|
-
override.ssh.username = box["aws"]["username"] if box["aws"]["username"]
|
94
|
-
override.ssh.private_key_path = box["aws"]["private_key_path"] if box["aws"]["private_key_path"]
|
95
|
-
|
96
|
-
# Alternative approach: add keys into your .bashrc or .zshrc profile
|
97
|
-
# export AWS_SECRET_KEY=secret_key
|
98
|
-
# export AWS_ACCESS_KEY=secret_key
|
99
|
-
aws.access_key_id = box["aws"]["access_key_id"] || ENV["AWS_ACCESS_KEY"]
|
100
|
-
aws.secret_access_key = box["aws"]["secret_access_key"] || ENV["AWS_SECRET_KEY"]
|
101
|
-
aws.session_token = box["aws"]["session_token"] || ENV["AWS_SESSION_TOKEN"]
|
102
|
-
|
103
|
-
# optional settings
|
104
|
-
aws.region = box["aws"]["region"] if box["aws"]["region"]
|
105
|
-
aws.availability_zone = box["aws"]["availability_zone"] if box["aws"]["availability_zone"]
|
106
|
-
aws.security_groups = box["aws"]["security_groups"] if box["aws"]["security_groups"]
|
107
|
-
aws.tags = box["aws"]["tags"] if box["aws"]["tags"]
|
108
|
-
aws.subnet_id = box["aws"]["subnet_id"] if box["aws"]["subnet_id"]
|
109
|
-
aws.availability_zone = box["aws"]["availability_zone"] if box["aws"]["availability_zone"]
|
110
|
-
aws.elastic_ip = box["aws"]["elastic_ip"] if box["aws"]["elastic_ip"]
|
111
|
-
aws.use_iam_profile = box["aws"]["use_iam_profile"] if box["aws"]["use_iam_profile"]
|
112
|
-
aws.private_ip_address = box["aws"]["private_ip_address"] if box["aws"]["private_ip_address"]
|
113
|
-
aws.user_data = box["aws"]["user_data"] if box["aws"]["user_data"]
|
114
|
-
aws.iam_instance_profile_name = box["aws"]["iam_instance_profile_name"] if box["aws"]["iam_instance_profile_name"]
|
115
|
-
aws.iam_instance_profile_arn = box["aws"]["iam_instance_profile_arn"] if box["aws"]["iam_instance_profile_arn"]
|
116
|
-
aws.instance_package_timeout = box["aws"]["instance_package_timeout"] if box["aws"]["instance_package_timeout"]
|
117
|
-
aws.instance_ready_timeout = box["aws"]["instance_ready_timeout"] if box["aws"]["instance_ready_timeout"]
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
node.vm.provider :digital_ocean do |digital_ocean, override|
|
122
|
-
if box["digital_ocean"]
|
123
|
-
override.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"
|
124
|
-
|
125
|
-
digital_ocean.token = box["digital_ocean"].include?("token") ? box["digital_ocean"]["token"] : ENV["DIGITAL_OCEAN_TOKEN"]
|
126
|
-
|
127
|
-
# Optional
|
128
|
-
override.ssh.private_key_path = box["digital_ocean"]["private_key_path"]
|
129
|
-
override.ssh.username = box["digital_ocean"]["username"] if box["digital_ocean"]["username"]
|
130
|
-
digital_ocean.ssh_key_name = box["digital_ocean"].include?("ssh_key_name") ? box["digital_ocean"]["ssh_key_name"] : 'Vagrant'
|
131
|
-
digital_ocean.image = box["digital_ocean"].include?("image") ? box["digital_ocean"]["image"] : "ubuntu-14-04-x64"
|
132
|
-
digital_ocean.region = box["digital_ocean"].include?("region") ? box["digital_ocean"]["region"] : "nyc2"
|
133
|
-
digital_ocean.size = box["digital_ocean"].include?("size") ? box["digital_ocean"]["size"] : "512mb"
|
134
|
-
digital_ocean.ipv6 = box["digital_ocean"].include?("ipv6") ? box["digital_ocean"]["ipv6"] : false
|
135
|
-
digital_ocean.private_networking = box["digital_ocean"].include?("private_networking") ? box["digital_ocean"]["private_networking"] : false
|
136
|
-
digital_ocean.backups_enabled = box["digital_ocean"].include?("backups_enabled") ? box["digital_ocean"]["backups_enabled"] : false
|
137
|
-
digital_ocean.setup = box["digital_ocean"].include?("setup") ? box["digital_ocean"]["setup"] : true
|
138
|
-
end
|
139
|
-
end
|
140
|
-
end
|
141
|
-
|
142
|
-
yield hostname, box if block_given?
|
143
|
-
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
|
-
def get_nodes(v=nil)
|
148
|
-
boxes = {}
|
149
|
-
|
150
|
-
return boxes if v["boxes"].empty?
|
151
|
-
|
152
|
-
v["boxes"].collect do |box|
|
153
|
-
next unless box["hostname"]
|
154
|
-
|
155
|
-
boxes[box["hostname"]] = {}
|
156
|
-
|
157
|
-
boxes[box["hostname"]]["box"] = v["box"] if v["box"]
|
158
|
-
boxes[box["hostname"]]["box"] = box["box"] if box["box"]
|
159
|
-
boxes[box["hostname"]]["box_check_update"] = box["box_check_update"] if box["box_check_update"]
|
160
|
-
boxes[box["hostname"]]["box_url"] = box["box_url"]
|
161
|
-
boxes[box["hostname"]]["box_check_update"] = box["box_check_update"]
|
162
|
-
boxes[box["hostname"]]["boot_timeout"] = box["boot_timeout"]
|
163
|
-
boxes[box["hostname"]]["box_download_checksum"] = box["box_download_checksum"]
|
164
|
-
boxes[box["hostname"]]["box_download_checksum_type"] = box["box_download_checksum_type"]
|
165
|
-
boxes[box["hostname"]]["box_download_client_cert"] = box["box_download_client_cert"]
|
166
|
-
boxes[box["hostname"]]["box_download_ca_cert"] = box["box_download_ca_cert"]
|
167
|
-
boxes[box["hostname"]]["box_download_ca_path"] = box["box_download_ca_path"]
|
168
|
-
boxes[box["hostname"]]["box_download_insecure"] = box["box_download_insecure"]
|
169
|
-
boxes[box["hostname"]]["box_version"] = box["box_version"]
|
170
|
-
boxes[box["hostname"]]["communicator"] = box["communicator"]
|
171
|
-
boxes[box["hostname"]]["graceful_halt_timeout"] = box["graceful_halt_timeout"]
|
172
|
-
boxes[box["hostname"]]["guest"] = box["guest"]
|
173
|
-
boxes[box["hostname"]]["post_up_message"] = box["post_up_message"]
|
174
|
-
boxes[box["hostname"]]["usable_port_range"] = box["usable_port_range"]
|
175
|
-
|
176
|
-
boxes[box["hostname"]]["ip"] = box["ip"] if box["ip"]
|
177
|
-
|
178
|
-
if box["provision"]
|
179
|
-
boxes[box["hostname"]]["provision"] ||= []
|
180
|
-
box["provision"].each do |shell|
|
181
|
-
boxes[box["hostname"]]["provision"].push(shell)
|
182
|
-
end
|
183
|
-
end
|
184
|
-
|
185
|
-
if box["forwarded_ports"]
|
186
|
-
boxes[box["hostname"]]["forwarded_ports"] ||= []
|
187
|
-
box["forwarded_ports"].each do |item|
|
188
|
-
next unless ( item.include?('host') or item.include?('guest') )
|
189
|
-
boxes[box["hostname"]]["forwarded_ports"].push(item)
|
190
|
-
end
|
191
|
-
end
|
192
|
-
|
193
|
-
box["synced_folders"] = box["shared_folders"] if box["shared_folders"]
|
194
|
-
|
195
|
-
if box["synced_folders"]
|
196
|
-
boxes[box["hostname"]]["synced_folders"] ||= []
|
197
|
-
box["synced_folders"].each do |item|
|
198
|
-
next unless ( item.include?('host') or item.include?('guest') )
|
199
|
-
folder_args = item.dup
|
200
|
-
folder_args.delete('host')
|
201
|
-
folder_args.delete('guest')
|
202
|
-
folder_args = Hash[folder_args.map{ |key, value| [key.to_sym, value] }]
|
203
|
-
|
204
|
-
boxes[box["hostname"]]["synced_folders"].push({host: "#{item["host"]}", guest: "#{item["guest"]}", args: folder_args})
|
205
|
-
end
|
206
|
-
end
|
207
|
-
|
208
|
-
if box["ssh"]
|
209
|
-
boxes[box["hostname"]]["ssh"] ||= {}
|
210
|
-
box["ssh"].each do |key, value|
|
211
|
-
boxes[box["hostname"]]["ssh"][key] = value
|
212
|
-
end
|
213
|
-
end
|
214
|
-
|
215
|
-
if box["disable_default_synced_folder"]
|
216
|
-
boxes[box["hostname"]]["synced_folders"] ||= []
|
217
|
-
boxes[box["hostname"]]["synced_folders"].push({ host:".", guest: "/vagrant", args: {id: "vagrant-root", disabled: true}})
|
218
|
-
end
|
219
|
-
|
220
|
-
box["memory"] = box["ram"] if box["ram"]
|
221
|
-
boxes[box["hostname"]]["memory"] = box["memory"] if box["memory"]
|
222
|
-
|
223
|
-
box["cpus"] = box["cpu"] if box["cpu"]
|
224
|
-
boxes[box["hostname"]]["cpus"] = box["cpus"] if box["cpus"]
|
225
|
-
|
226
|
-
boxes[box["hostname"]]["gui"] = box["gui"] if box["gui"]
|
227
|
-
boxes[box["hostname"]]["disable_vm_optimization"] = box["disable_vm_optimization"] if box.include? "disable_vm_optimization"
|
228
|
-
|
229
|
-
boxes[box["hostname"]]["aws"] = box["aws"] if box["aws"]
|
230
|
-
boxes[box["hostname"]]["digital_ocean"] = box["digital_ocean"] if box["digital_ocean"]
|
231
|
-
end
|
232
|
-
|
233
|
-
boxes
|
234
|
-
end
|