vagrant-dotvm 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/vagrant-dotvm.rb +9 -1
- data/lib/vagrant-dotvm/config/provision.rb +1 -0
- data/lib/vagrant-dotvm/dotvm.rb +2 -4
- data/lib/vagrant-dotvm/injector/authorizedkey.rb +21 -0
- data/lib/vagrant-dotvm/injector/host.rb +15 -0
- data/lib/vagrant-dotvm/injector/machine.rb +96 -0
- data/lib/vagrant-dotvm/injector/network.rb +33 -0
- data/lib/vagrant-dotvm/injector/provision.rb +146 -0
- data/lib/vagrant-dotvm/injector/root.rb +25 -0
- data/lib/vagrant-dotvm/injector/route.rb +15 -0
- data/lib/vagrant-dotvm/injector/sharedfolder.rb +39 -0
- data/lib/vagrant-dotvm/version.rb +1 -1
- data/vagrant-dotvm.gemspec +1 -1
- metadata +11 -4
- data/lib/vagrant-dotvm/configinjecter.rb +0 -162
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6d538d3645fe69b4fda9fc292f0fdaafb222cbf
|
4
|
+
data.tar.gz: 4c25a64b1472dd6636f6b180872cf381e6751c48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3e851140912f7c3ad8372dc94477d595d7d578ff42ccefafef1fb7278aa23d0223a919ec63788b850f60b6430e6396c46f0f906227a64ef34d6fa16e1737799
|
7
|
+
data.tar.gz: 202f8824f810364eea87a4a08778c32be19e3c64595445d2dd323b65d6bbaca48b982b3652cb2cd76a0de2491655633cde48ca7a7f7120415c3da3b3a8b36d72
|
data/CHANGELOG.md
CHANGED
data/lib/vagrant-dotvm.rb
CHANGED
@@ -4,7 +4,15 @@ require 'yaml'
|
|
4
4
|
require 'vagrant-dotvm/plugin'
|
5
5
|
require 'vagrant-dotvm/version'
|
6
6
|
require 'vagrant-dotvm/dotvm'
|
7
|
-
|
7
|
+
|
8
|
+
require 'vagrant-dotvm/injector/root'
|
9
|
+
require 'vagrant-dotvm/injector/machine'
|
10
|
+
require 'vagrant-dotvm/injector/provision'
|
11
|
+
require 'vagrant-dotvm/injector/authorizedkey'
|
12
|
+
require 'vagrant-dotvm/injector/host'
|
13
|
+
require 'vagrant-dotvm/injector/sharedfolder'
|
14
|
+
require 'vagrant-dotvm/injector/route'
|
15
|
+
require 'vagrant-dotvm/injector/network'
|
8
16
|
|
9
17
|
require 'vagrant-dotvm/config/abstractconfig'
|
10
18
|
require 'vagrant-dotvm/config/root'
|
data/lib/vagrant-dotvm/dotvm.rb
CHANGED
@@ -0,0 +1,21 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module Dotvm
|
3
|
+
module Injector
|
4
|
+
class AuthorizedKey
|
5
|
+
def self.inject(key: nil, machine: nil)
|
6
|
+
if key.type == "file"
|
7
|
+
pubkey = File.readlines(File.expand_path(key.path)).first.strip
|
8
|
+
elsif key.type == "static"
|
9
|
+
pubkey = key.key
|
10
|
+
end
|
11
|
+
|
12
|
+
machine.vm.provision "shell" do |s|
|
13
|
+
s.path = File.dirname(__FILE__) + "/../../utils/authorize_key.sh"
|
14
|
+
s.args = [pubkey]
|
15
|
+
s.privileged = false
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module Dotvm
|
3
|
+
module Injector
|
4
|
+
class Host
|
5
|
+
def self.inject(host: nil, machine: nil)
|
6
|
+
machine.vm.provision "shell", run: "always" do |s|
|
7
|
+
s.path = File.dirname(__FILE__) + "/../../utils/add_host.sh"
|
8
|
+
s.args = [host.ip, host.host]
|
9
|
+
s.privileged = true
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module Dotvm
|
3
|
+
module Injector
|
4
|
+
class Machine
|
5
|
+
BOX_OPTIONS = [
|
6
|
+
:box,
|
7
|
+
:hostname,
|
8
|
+
:boot_timeout,
|
9
|
+
:box_check_update,
|
10
|
+
:box_version,
|
11
|
+
:graceful_halt_timeout,
|
12
|
+
:post_up_message,
|
13
|
+
:box_download_checksum,
|
14
|
+
:box_download_checksum_type,
|
15
|
+
:box_download_client_cert,
|
16
|
+
:box_download_ca_cert,
|
17
|
+
:box_download_ca_path,
|
18
|
+
:box_download_insecure,
|
19
|
+
:box_download_location_trusted,
|
20
|
+
:box_url,
|
21
|
+
:communicator,
|
22
|
+
:guest,
|
23
|
+
:usable_port_range,
|
24
|
+
]
|
25
|
+
|
26
|
+
def self.inject(machine_cfg: nil, vc: nil)
|
27
|
+
define_opts = {}
|
28
|
+
define_opts[:primary] = machine_cfg.primary unless machine_cfg.primary.nil?
|
29
|
+
define_opts[:autostart] = machine_cfg.autostart unless machine_cfg.autostart.nil?
|
30
|
+
|
31
|
+
vc.vm.define machine_cfg.nick, **define_opts do |machine|
|
32
|
+
BOX_OPTIONS.each do |opt|
|
33
|
+
val = machine_cfg.send(opt)
|
34
|
+
machine.vm.send("#{opt}=", val) unless val.nil?
|
35
|
+
end
|
36
|
+
|
37
|
+
machine.vm.provider "virtualbox" do |vb|
|
38
|
+
vb.customize ["modifyvm", :id, "--memory", machine_cfg.memory] unless machine_cfg.memory.nil?
|
39
|
+
vb.customize ["modifyvm", :id, "--cpus", machine_cfg.cpus] unless machine_cfg.cpus.nil?
|
40
|
+
vb.customize ["modifyvm", :id, "--cpuexecutioncap", machine_cfg.cpucap] unless machine_cfg.cpucap.nil?
|
41
|
+
vb.customize ["modifyvm", :id, "--natnet1", machine_cfg.natnet] unless machine_cfg.natnet.nil?
|
42
|
+
|
43
|
+
machine_cfg.options[:virtualbox].each do |option|
|
44
|
+
vb.customize ["modifyvm", :id, option.name, option.value]
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
machine.vm.provider "vmware_fusion" do |vf|
|
49
|
+
vf.vmx["memsize"] = machine_cfg.memory unless machine_cfg.memory.nil?
|
50
|
+
vf.vmz["numvcpus"] = machine_cfg.cpus unless machine_cfg.cpus.nil?
|
51
|
+
end
|
52
|
+
|
53
|
+
machine_cfg.networks.each do |net|
|
54
|
+
Network.inject net: net,
|
55
|
+
machine: machine
|
56
|
+
end
|
57
|
+
|
58
|
+
machine_cfg.routes.each do |route|
|
59
|
+
Route.inject route: route,
|
60
|
+
machine: machine
|
61
|
+
end
|
62
|
+
|
63
|
+
machine_cfg.hosts.each do |host|
|
64
|
+
Host.inject host: host,
|
65
|
+
machine: machine
|
66
|
+
end
|
67
|
+
|
68
|
+
machine_cfg.provision.each do |provision|
|
69
|
+
Provision.inject provision_cfg: provision,
|
70
|
+
machine: machine
|
71
|
+
end
|
72
|
+
|
73
|
+
machine_cfg.shared_folders.each do |folder|
|
74
|
+
SharedFolder.inject folder: folder,
|
75
|
+
machine: machine
|
76
|
+
end
|
77
|
+
|
78
|
+
machine_cfg.authorized_keys.each do |key|
|
79
|
+
AuthorizedKey.inject key: key,
|
80
|
+
machine: machine
|
81
|
+
end
|
82
|
+
|
83
|
+
if Vagrant.has_plugin?("vagrant-group")
|
84
|
+
vc.group.groups = {} unless vc.group.groups.kind_of?(Hash)
|
85
|
+
|
86
|
+
machine_cfg.groups.each do |group|
|
87
|
+
vc.group.groups[group] = [] unless vc.group.groups.has_key?(group)
|
88
|
+
vc.group.groups[group] << machine_cfg.nick
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module Dotvm
|
3
|
+
module Injector
|
4
|
+
class Network
|
5
|
+
OPTIONS = [
|
6
|
+
:type,
|
7
|
+
:ip,
|
8
|
+
:netmask,
|
9
|
+
:virtualbox__intnet,
|
10
|
+
:guest,
|
11
|
+
:host,
|
12
|
+
:protocol,
|
13
|
+
:bridge,
|
14
|
+
:guest_ip,
|
15
|
+
:host_ip,
|
16
|
+
:auto_correct,
|
17
|
+
:auto_config,
|
18
|
+
]
|
19
|
+
|
20
|
+
def self.inject(net: nil, machine: nil)
|
21
|
+
hash = {}
|
22
|
+
|
23
|
+
OPTIONS.each do |opt|
|
24
|
+
val = net.send(opt)
|
25
|
+
hash[opt] = val unless val.nil?
|
26
|
+
end
|
27
|
+
|
28
|
+
machine.vm.network net.net, **hash
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,146 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module Dotvm
|
3
|
+
module Injector
|
4
|
+
class Provision
|
5
|
+
OPTIONS = [
|
6
|
+
:path,
|
7
|
+
:inline,
|
8
|
+
:args,
|
9
|
+
:privileged,
|
10
|
+
:source,
|
11
|
+
:destination,
|
12
|
+
:module_path,
|
13
|
+
:manifest_file,
|
14
|
+
:manifests_path,
|
15
|
+
:binary_path,
|
16
|
+
:hiera_config_path,
|
17
|
+
:environment,
|
18
|
+
:environment_path,
|
19
|
+
:binary,
|
20
|
+
:upload_path,
|
21
|
+
:keep_color,
|
22
|
+
:name,
|
23
|
+
:powershell_args,
|
24
|
+
:facter,
|
25
|
+
:options,
|
26
|
+
:synced_folder_type,
|
27
|
+
:temp_dir,
|
28
|
+
:working_directory,
|
29
|
+
:client_cert_path,
|
30
|
+
:client_private_key_path,
|
31
|
+
:puppet_node,
|
32
|
+
:puppet_server,
|
33
|
+
:minion_config,
|
34
|
+
:run_highstate,
|
35
|
+
:install_master,
|
36
|
+
:no_minion,
|
37
|
+
:install_syndic,
|
38
|
+
:install_type,
|
39
|
+
:install_args,
|
40
|
+
:install_command,
|
41
|
+
:always_install,
|
42
|
+
:bootstrap_script,
|
43
|
+
:bootstrap_options,
|
44
|
+
:version,
|
45
|
+
:minion_key,
|
46
|
+
:minion_id,
|
47
|
+
:minion_pub,
|
48
|
+
:grains_config,
|
49
|
+
:masterless,
|
50
|
+
:master_config,
|
51
|
+
:master_key,
|
52
|
+
:master_pub,
|
53
|
+
:seed_master,
|
54
|
+
:run_highstate,
|
55
|
+
:run_overstate,
|
56
|
+
:orchestrations,
|
57
|
+
:colorize,
|
58
|
+
:log_level,
|
59
|
+
:am_policy_hub,
|
60
|
+
:extra_agent_args,
|
61
|
+
:classes,
|
62
|
+
:deb_repo_file,
|
63
|
+
:deb_repo_line,
|
64
|
+
:files_path,
|
65
|
+
:force_bootstrap,
|
66
|
+
:install,
|
67
|
+
:mode,
|
68
|
+
:policy_server_address,
|
69
|
+
:repo_gpg_key_url,
|
70
|
+
:run_file,
|
71
|
+
:upload_path,
|
72
|
+
:yum_repo_file,
|
73
|
+
:yum_repo_url,
|
74
|
+
:package_name,
|
75
|
+
:groups,
|
76
|
+
:inventory_path,
|
77
|
+
:playbook,
|
78
|
+
:extra_vars,
|
79
|
+
:sudo,
|
80
|
+
:sudo_user,
|
81
|
+
:ask_sudo_pass,
|
82
|
+
:ask_vault_pass,
|
83
|
+
:vault_password_file,
|
84
|
+
:limit,
|
85
|
+
:verbose,
|
86
|
+
:tags,
|
87
|
+
:skip_tags,
|
88
|
+
:start_at_task,
|
89
|
+
:raw_arguments,
|
90
|
+
:raw_ssh_args,
|
91
|
+
:host_key_checking,
|
92
|
+
:cookbooks_path,
|
93
|
+
:data_bags_path,
|
94
|
+
:environments_path,
|
95
|
+
:recipe_url,
|
96
|
+
:roles_path,
|
97
|
+
:binary_env,
|
98
|
+
:installer_download_path,
|
99
|
+
:prerelease,
|
100
|
+
:arguments,
|
101
|
+
:attempts,
|
102
|
+
:custom_config_path,
|
103
|
+
:encrypted_data_bag_secret_key_path,
|
104
|
+
:formatter,
|
105
|
+
:http_proxy,
|
106
|
+
:http_proxy_user,
|
107
|
+
:http_proxy_pass,
|
108
|
+
:no_proxy,
|
109
|
+
:json,
|
110
|
+
:node_name,
|
111
|
+
:provisioning_path,
|
112
|
+
:run_list,
|
113
|
+
:file_cache_path,
|
114
|
+
:file_backup_path,
|
115
|
+
:verbose_logging,
|
116
|
+
:enable_reporting,
|
117
|
+
:client_key_path,
|
118
|
+
:validation_client_name,
|
119
|
+
:delete_node,
|
120
|
+
:delete_client,
|
121
|
+
:recipe,
|
122
|
+
]
|
123
|
+
|
124
|
+
public
|
125
|
+
def self.inject(provision_cfg: nil, machine: nil)
|
126
|
+
machine.vm.provision provision_cfg.type, run: provision_cfg.run do |p|
|
127
|
+
OPTIONS.each do |opt|
|
128
|
+
val = provision_cfg.send(opt)
|
129
|
+
p.send("#{opt}=", val) unless val.nil?
|
130
|
+
end
|
131
|
+
|
132
|
+
provision_cfg.recipes.to_a.each do |recipe|
|
133
|
+
p.add_recipe(recipe)
|
134
|
+
end
|
135
|
+
|
136
|
+
provision_cfg.roles.to_a.each do |role|
|
137
|
+
p.add_role(role)
|
138
|
+
end
|
139
|
+
|
140
|
+
p.pillar provision_cfg.pillar unless provision_cfg.pillar.nil?
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module Dotvm
|
3
|
+
module Injector
|
4
|
+
class Root
|
5
|
+
def self.inject(config: nil, vc: nil)
|
6
|
+
config.options[:ssh].each do |option|
|
7
|
+
vc.ssh.send("#{option.name}=", option.value)
|
8
|
+
end
|
9
|
+
|
10
|
+
config.options[:winrm].each do |option|
|
11
|
+
vc.winrm.send("#{option.name}=", option.value)
|
12
|
+
end
|
13
|
+
|
14
|
+
config.options[:vagrant].each do |option|
|
15
|
+
vc.vagrant.send("#{option.name}=", option.value)
|
16
|
+
end
|
17
|
+
|
18
|
+
config.machines.each do |machine_cfg|
|
19
|
+
Machine.inject machine_cfg: machine_cfg, vc: vc
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end # Root
|
23
|
+
end # Injector
|
24
|
+
end # Dotvm
|
25
|
+
end # VagrantPlugins
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module Dotvm
|
3
|
+
module Injector
|
4
|
+
class Route
|
5
|
+
def self.inject(route: nil, machine: nil)
|
6
|
+
machine.vm.provision "shell", run: "always" do |s|
|
7
|
+
s.path = File.dirname(__FILE__) + "/../../../utils/setup_route.sh"
|
8
|
+
s.args = [route.destination, route.gateway]
|
9
|
+
s.privileged = true
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module Dotvm
|
3
|
+
module Injector
|
4
|
+
class SharedFolder
|
5
|
+
OPTIONS = [
|
6
|
+
:disabled,
|
7
|
+
:create,
|
8
|
+
:type,
|
9
|
+
:group,
|
10
|
+
:mount_options,
|
11
|
+
:owner,
|
12
|
+
:nfs_export,
|
13
|
+
:nfs_udp,
|
14
|
+
:nfs_version,
|
15
|
+
:rsync__args,
|
16
|
+
:rsync__auto,
|
17
|
+
:rsync__chown,
|
18
|
+
:rsync__exclude,
|
19
|
+
:rsync__rsync_path,
|
20
|
+
:rsync__verbose,
|
21
|
+
:smb_host,
|
22
|
+
:smb_password,
|
23
|
+
:smb_username,
|
24
|
+
]
|
25
|
+
|
26
|
+
def self.inject(folder: nil, machine: nil)
|
27
|
+
hash = {}
|
28
|
+
|
29
|
+
OPTIONS.each do |opt|
|
30
|
+
val = folder.send(opt)
|
31
|
+
hash[opt] = val unless val.nil?
|
32
|
+
end
|
33
|
+
|
34
|
+
machine.vm.synced_folder folder.host, folder.guest, **hash
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/vagrant-dotvm.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Krzysztof Magosa"]
|
10
10
|
spec.email = ["krzysztof@magosa.pl"]
|
11
11
|
spec.summary = "Easy YAML based multi machine config approach for Vagrant."
|
12
|
-
spec.homepage = "http://github.com/
|
12
|
+
spec.homepage = "http://github.com/vagrant-dotvm/vagrant-dotvm"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-dotvm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.30.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Krzysztof Magosa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -70,15 +70,22 @@ files:
|
|
70
70
|
- lib/vagrant-dotvm/config/root.rb
|
71
71
|
- lib/vagrant-dotvm/config/route.rb
|
72
72
|
- lib/vagrant-dotvm/config/sharedfolder.rb
|
73
|
-
- lib/vagrant-dotvm/configinjecter.rb
|
74
73
|
- lib/vagrant-dotvm/dotvm.rb
|
74
|
+
- lib/vagrant-dotvm/injector/authorizedkey.rb
|
75
|
+
- lib/vagrant-dotvm/injector/host.rb
|
76
|
+
- lib/vagrant-dotvm/injector/machine.rb
|
77
|
+
- lib/vagrant-dotvm/injector/network.rb
|
78
|
+
- lib/vagrant-dotvm/injector/provision.rb
|
79
|
+
- lib/vagrant-dotvm/injector/root.rb
|
80
|
+
- lib/vagrant-dotvm/injector/route.rb
|
81
|
+
- lib/vagrant-dotvm/injector/sharedfolder.rb
|
75
82
|
- lib/vagrant-dotvm/plugin.rb
|
76
83
|
- lib/vagrant-dotvm/version.rb
|
77
84
|
- utils/add_host.sh
|
78
85
|
- utils/authorize_key.sh
|
79
86
|
- utils/setup_route.sh
|
80
87
|
- vagrant-dotvm.gemspec
|
81
|
-
homepage: http://github.com/
|
88
|
+
homepage: http://github.com/vagrant-dotvm/vagrant-dotvm
|
82
89
|
licenses:
|
83
90
|
- MIT
|
84
91
|
metadata: {}
|
@@ -1,162 +0,0 @@
|
|
1
|
-
module VagrantPlugins
|
2
|
-
module Dotvm
|
3
|
-
class ConfigInjecter
|
4
|
-
|
5
|
-
public
|
6
|
-
def self.inject(config, vc)
|
7
|
-
config.options[:ssh].each do |option|
|
8
|
-
vc.ssh.send("#{option.name}=", option.value)
|
9
|
-
end
|
10
|
-
|
11
|
-
config.options[:winrm].each do |option|
|
12
|
-
vc.winrm.send("#{option.name}=", option.value)
|
13
|
-
end
|
14
|
-
|
15
|
-
config.options[:vagrant].each do |option|
|
16
|
-
vc.vagrant.send("#{option.name}=", option.value)
|
17
|
-
end
|
18
|
-
|
19
|
-
config.machines.each do |machine_cfg|
|
20
|
-
define_opts = {}
|
21
|
-
define_opts[:primary] = machine_cfg.primary unless machine_cfg.primary.nil?
|
22
|
-
define_opts[:autostart] = machine_cfg.autostart unless machine_cfg.autostart.nil?
|
23
|
-
|
24
|
-
vc.vm.define machine_cfg.nick, **define_opts do |machine|
|
25
|
-
[
|
26
|
-
:box, :hostname, :boot_timeout, :box_check_update, :box_version, :graceful_halt_timeout, :post_up_message,
|
27
|
-
:box_download_checksum, :box_download_checksum_type, :box_download_client_cert, :box_download_ca_cert,
|
28
|
-
:box_download_ca_path, :box_download_insecure, :box_download_location_trusted, :box_url, :communicator,
|
29
|
-
:guest, :usable_port_range
|
30
|
-
].each do |opt|
|
31
|
-
val = machine_cfg.send(opt)
|
32
|
-
machine.vm.send("#{opt}=", val) unless val.nil?
|
33
|
-
end
|
34
|
-
|
35
|
-
machine.vm.provider "virtualbox" do |vb|
|
36
|
-
vb.customize ["modifyvm", :id, "--memory", machine_cfg.memory] unless machine_cfg.memory.nil?
|
37
|
-
vb.customize ["modifyvm", :id, "--cpus", machine_cfg.cpus] unless machine_cfg.cpus.nil?
|
38
|
-
vb.customize ["modifyvm", :id, "--cpuexecutioncap", machine_cfg.cpucap] unless machine_cfg.cpucap.nil?
|
39
|
-
vb.customize ["modifyvm", :id, "--natnet1", machine_cfg.natnet] unless machine_cfg.natnet.nil?
|
40
|
-
|
41
|
-
machine_cfg.options[:virtualbox].each do |option|
|
42
|
-
vb.customize ["modifyvm", :id, option.name, option.value]
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
machine.vm.provider "vmware_fusion" do |vf|
|
47
|
-
vf.vmx["memsize"] = machine_cfg.memory unless machine_cfg.memory.nil?
|
48
|
-
vf.vmz["numvcpus"] = machine_cfg.cpus unless machine_cfg.cpus.nil?
|
49
|
-
end
|
50
|
-
|
51
|
-
machine_cfg.networks.each do |net|
|
52
|
-
hash = {}
|
53
|
-
|
54
|
-
[
|
55
|
-
:type, :ip, :netmask, :virtualbox__intnet, :guest, :host, :protocol, :bridge,
|
56
|
-
:guest_ip, :host_ip, :auto_correct, :auto_config,
|
57
|
-
].each do |opt|
|
58
|
-
val = net.send(opt)
|
59
|
-
hash[opt] = val unless val.nil?
|
60
|
-
end
|
61
|
-
|
62
|
-
machine.vm.network net.net, **hash
|
63
|
-
end
|
64
|
-
|
65
|
-
machine_cfg.routes.each do |route|
|
66
|
-
machine.vm.provision "shell", run: "always" do |s|
|
67
|
-
s.path = File.dirname(__FILE__) + "/../../utils/setup_route.sh"
|
68
|
-
s.args = [route.destination, route.gateway]
|
69
|
-
s.privileged = true
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
machine_cfg.hosts.each do |host|
|
74
|
-
machine.vm.provision "shell", run: "always" do |s|
|
75
|
-
s.path = File.dirname(__FILE__) + "/../../utils/add_host.sh"
|
76
|
-
s.args = [host.ip, host.host]
|
77
|
-
s.privileged = true
|
78
|
-
end
|
79
|
-
end
|
80
|
-
|
81
|
-
machine_cfg.provision.each do |provision|
|
82
|
-
machine.vm.provision provision.type, run: provision.run do |p|
|
83
|
-
[
|
84
|
-
:path, :inline, :args, :privileged, :source, :destination, :module_path, :manifest_file,
|
85
|
-
:manifests_path, :binary_path, :hiera_config_path, :environment, :environment_path,
|
86
|
-
:binary, :upload_path, :keep_color, :name, :powershell_args, :facter, :options,
|
87
|
-
:synced_folder_type, :temp_dir, :working_directory, :client_cert_path, :client_private_key_path,
|
88
|
-
:puppet_node, :puppet_server, :minion_config, :run_highstate, :install_master, :no_minion,
|
89
|
-
:install_syndic, :install_type, :install_args, :install_command, :always_install, :bootstrap_script,
|
90
|
-
:bootstrap_options, :version, :minion_key, :minion_id, :minion_pub, :grains_config, :masterless,
|
91
|
-
:master_config, :master_key, :master_pub, :seed_master, :run_highstate, :run_overstate,
|
92
|
-
:orchestrations, :colorize, :log_level, :am_policy_hub, :extra_agent_args, :classes,
|
93
|
-
:deb_repo_file, :deb_repo_line, :files_path, :force_bootstrap, :install, :mode,
|
94
|
-
:policy_server_address, :repo_gpg_key_url, :run_file, :upload_path, :yum_repo_file,
|
95
|
-
:yum_repo_url, :package_name, :groups, :inventory_path, :playbook, :extra_vars,
|
96
|
-
:sudo, :sudo_user, :ask_sudo_pass, :ask_vault_pass, :vault_password_file, :limit,
|
97
|
-
:verbose, :tags, :skip_tags, :start_at_task, :raw_arguments, :raw_ssh_args, :host_key_checking,
|
98
|
-
:cookbooks_path, :data_bags_path, :environments_path, :recipe_url, :roles_path, :binary_env,
|
99
|
-
:installer_download_path, :prerelease, :arguments, :attempts, :custom_config_path,
|
100
|
-
:encrypted_data_bag_secret_key_path, :formatter, :http_proxy, :http_proxy_user,
|
101
|
-
:http_proxy_pass, :no_proxy, :json, :node_name, :provisioning_path, :run_list,
|
102
|
-
:file_cache_path, :file_backup_path, :verbose_logging, :enable_reporting,
|
103
|
-
:client_key_path, :validation_client_name, :delete_node, :delete_client, :recipe,
|
104
|
-
].each do |opt|
|
105
|
-
val = provision.send(opt)
|
106
|
-
p.send("#{opt}=", val) unless val.nil?
|
107
|
-
end
|
108
|
-
|
109
|
-
provision.recipes.to_a.each do |recipe|
|
110
|
-
p.add_recipe(recipe)
|
111
|
-
end
|
112
|
-
|
113
|
-
provision.roles.to_a.each do |role|
|
114
|
-
p.add_role(role)
|
115
|
-
end
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
machine_cfg.shared_folders.each do |folder|
|
120
|
-
hash = {}
|
121
|
-
|
122
|
-
[
|
123
|
-
:disabled, :create, :type, :group, :mount_options, :owner, :nfs_export, :nfs_udp, :nfs_version,
|
124
|
-
:rsync__args, :rsync__auto, :rsync__chown, :rsync__exclude, :rsync__rsync_path, :rsync__verbose,
|
125
|
-
:smb_host, :smb_password, :smb_username
|
126
|
-
].each do |opt|
|
127
|
-
val = folder.send(opt)
|
128
|
-
hash[opt] = val unless val.nil?
|
129
|
-
end
|
130
|
-
|
131
|
-
machine.vm.synced_folder folder.host, folder.guest, **hash
|
132
|
-
end
|
133
|
-
|
134
|
-
machine_cfg.authorized_keys.each do |key|
|
135
|
-
if key.type == "file"
|
136
|
-
pubkey = File.readlines(File.expand_path(key.path)).first.strip
|
137
|
-
elsif key.type == "static"
|
138
|
-
pubkey = key.key
|
139
|
-
end
|
140
|
-
|
141
|
-
machine.vm.provision "shell" do |s|
|
142
|
-
s.path = File.dirname(__FILE__) + "/../../utils/authorize_key.sh"
|
143
|
-
s.args = [pubkey]
|
144
|
-
s.privileged = false
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
if Vagrant.has_plugin?("vagrant-group")
|
149
|
-
vc.group.groups = {} unless vc.group.groups.kind_of?(Hash)
|
150
|
-
|
151
|
-
machine_cfg.groups.each do |group|
|
152
|
-
vc.group.groups[group] = [] unless vc.group.groups.has_key?(group)
|
153
|
-
vc.group.groups[group] << machine_cfg.nick
|
154
|
-
end
|
155
|
-
end
|
156
|
-
end
|
157
|
-
end
|
158
|
-
end
|
159
|
-
|
160
|
-
end # ConfigInjecter
|
161
|
-
end # Dotvm
|
162
|
-
end # VagrantPlugins
|