vagrant-config_builder 0.15.1 → 1.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +18 -4
- data/CHANGELOG +44 -0
- data/Gemfile +3 -4
- data/lib/config_builder/model/base.rb +182 -8
- data/lib/config_builder/model/network/forwarded_port.rb +34 -13
- data/lib/config_builder/model/network/private_network.rb +17 -1
- data/lib/config_builder/model/network/public_network.rb +39 -0
- data/lib/config_builder/model/nfs.rb +33 -0
- data/lib/config_builder/model/provider/aws.rb +16 -39
- data/lib/config_builder/model/provider/azure.rb +11 -33
- data/lib/config_builder/model/provider/base.rb +37 -0
- data/lib/config_builder/model/provider/libvirt.rb +33 -39
- data/lib/config_builder/model/provider/openstack.rb +69 -0
- data/lib/config_builder/model/provider/openstack_plugin.rb +46 -0
- data/lib/config_builder/model/provider/softlayer.rb +85 -0
- data/lib/config_builder/model/provider/virtualbox.rb +84 -17
- data/lib/config_builder/model/provider/vmware.rb +6 -4
- data/lib/config_builder/model/provider/vsphere.rb +33 -15
- data/lib/config_builder/model/provisioner/base.rb +33 -0
- data/lib/config_builder/model/provisioner/file.rb +1 -10
- data/lib/config_builder/model/provisioner/puppet.rb +32 -22
- data/lib/config_builder/model/provisioner/puppet_server.rb +21 -15
- data/lib/config_builder/model/provisioner/shell.rb +28 -10
- data/lib/config_builder/model/root.rb +28 -4
- data/lib/config_builder/model/ssh.rb +29 -11
- data/lib/config_builder/model/synced_folder.rb +83 -14
- data/lib/config_builder/model/vm.rb +111 -52
- data/lib/config_builder/model/winrm.rb +27 -7
- data/lib/config_builder/model.rb +9 -1
- data/lib/config_builder/model_delegator.rb +5 -24
- data/lib/config_builder/version.rb +1 -1
- data/spec/integration/vagrant/root_config_spec.rb +89 -0
- data/spec/integration/vagrant/vm_config_spec.rb +101 -0
- data/spec/integration/vagrant/vm_provider_spec.rb +57 -0
- data/spec/integration/vagrant/vm_provisioner_spec.rb +90 -0
- data/spec/spec_helper.rb +6 -2
- data/spec/{config_builder → unit}/filter/boxes_spec.rb +0 -0
- data/spec/{config_builder → unit}/filter/roles_spec.rb +0 -0
- data/spec/{config_builder → unit}/loader/yaml_spec.rb +0 -0
- data/spec/unit/model/base_spec.rb +122 -0
- data/spec/{config_builder → unit}/model/provider/vmware_fusion_spec.rb +6 -5
- data/templates/locales/en.yml +4 -0
- metadata +33 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d41a4ada74b11df745bb0eaa5f9ec0cf4a41300f
|
4
|
+
data.tar.gz: eb70c9e062acd752cc5cb90d2a2d42100c91cc2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f88a46a53e18afcb4645efb9dafdce983eeaf13f6e72a6d3f780ac997943f9eb4b1311b5bbf9437fb506004035a02c8bdb21928bfbe60486cbce0c249c859e7
|
7
|
+
data.tar.gz: 0737858435ef1b126ddbf16b04c8255f250e5f9c96508729c9acaee893512d1ce0ad74f4ba640288ba29239f40b46d37b7433914665e14b75b61e23f31b004c3
|
data/.travis.yml
CHANGED
@@ -1,12 +1,26 @@
|
|
1
1
|
---
|
2
2
|
language: ruby
|
3
3
|
sudo: false
|
4
|
-
|
5
|
-
|
4
|
+
before_install:
|
5
|
+
- gem install bundler --version $BUNDLER_VERSION
|
6
|
+
install: bundle _${BUNDLER_VERSION}_ install --without development
|
7
|
+
script: bundle _${BUNDLER_VERSION}_ exec rspec --color --format documentation
|
6
8
|
notifications:
|
7
9
|
email: false
|
8
|
-
|
9
|
-
- 2.0.0
|
10
|
+
|
10
11
|
env:
|
11
12
|
global:
|
12
13
|
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
14
|
+
|
15
|
+
matrix:
|
16
|
+
include:
|
17
|
+
- rvm: 2.0.0
|
18
|
+
env: TEST_VAGRANT_VERSION=v1.6.5 BUNDLER_VERSION=1.6.9
|
19
|
+
- rvm: 2.0.0
|
20
|
+
env: TEST_VAGRANT_VERSION=v1.7.4 BUNDLER_VERSION=1.10.5
|
21
|
+
|
22
|
+
- rvm: 2.2.3
|
23
|
+
env: TEST_VAGRANT_VERSION=v1.8.1 BUNDLER_VERSION=1.10.6
|
24
|
+
- rvm: 2.2.3
|
25
|
+
env: TEST_VAGRANT_VERSION=HEAD BUNDLER_VERSION=1.10.6
|
26
|
+
|
data/CHANGELOG
CHANGED
@@ -1,6 +1,50 @@
|
|
1
1
|
CHANGELOG
|
2
2
|
=========
|
3
3
|
|
4
|
+
1.0.0
|
5
|
+
-----
|
6
|
+
|
7
|
+
(unreleased)
|
8
|
+
|
9
|
+
This is a major feature release with small breaks in backwards compatibility.
|
10
|
+
|
11
|
+
* (GH-48) Add support for the create, group and owner synced_folder options.
|
12
|
+
|
13
|
+
* (GH-50) Add support for vagrant-openstack-provider and
|
14
|
+
vagrant-openstack-plugin.
|
15
|
+
|
16
|
+
* (GH-51) Add support for the vagrant-softlayer provider.
|
17
|
+
|
18
|
+
* (GH-52) Support for new Vagrant 1.8.1 features and a sweeping refresh of
|
19
|
+
just about every data model to ensure most Vagrant configuration options are
|
20
|
+
supported.
|
21
|
+
|
22
|
+
* (GH-53) Models now require much, much less boilerplate. In most cases, a
|
23
|
+
a class that inherits form Model::Base and uses def_model_attribute will
|
24
|
+
Do The Right Thing™ without requiring further code.
|
25
|
+
|
26
|
+
* (GH-46) All provider models inheriting from Model::Provider::Base now
|
27
|
+
support provider-specific overrides. All core provider models have been
|
28
|
+
refactored to use this base class.
|
29
|
+
|
30
|
+
* ModelDelegator functionality has been moved to Model::Base to support
|
31
|
+
(GH-46). The ModelDelegator module still exists but is deprecated and does
|
32
|
+
nothing.
|
33
|
+
|
34
|
+
* (GH-40) All provisioner models inheriting from Model::Provisioner::Base now
|
35
|
+
support provisioner-specific options such as name and run. All core
|
36
|
+
provisioner models have been refactored to use this base class.
|
37
|
+
|
38
|
+
* BREAK: The name attribute of the shell provisioner has been re-purposed to
|
39
|
+
support named provisioners in (GH-40).
|
40
|
+
|
41
|
+
* There is now an integration suite that tests whether config_builder
|
42
|
+
correctly transforms data into Vagrant objects.
|
43
|
+
|
44
|
+
Many thanks to Brett Delle Grazie and Christoph Fiehe for their contributions
|
45
|
+
to this release.
|
46
|
+
|
47
|
+
|
4
48
|
0.15.1
|
5
49
|
------
|
6
50
|
|
data/Gemfile
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
|
-
ruby '2.0.0' # Required by Vagrant 1.4 and newer.
|
3
2
|
|
4
|
-
ENV['TEST_VAGRANT_VERSION'] ||= 'v1.
|
3
|
+
ENV['TEST_VAGRANT_VERSION'] ||= 'v1.8.1'
|
5
4
|
|
6
5
|
# Wrapping gemspec in the :plugins group causes Vagrant 1.5 and newer to
|
7
6
|
# automagically load this plugin during acceptance tests.
|
@@ -21,8 +20,8 @@ group :test do
|
|
21
20
|
gem 'vagrant', :github => 'mitchellh/vagrant', :tag => ENV['TEST_VAGRANT_VERSION']
|
22
21
|
end
|
23
22
|
|
24
|
-
# Pinned on
|
25
|
-
gem 'vagrant-spec', :github => 'mitchellh/vagrant-spec', :ref => '
|
23
|
+
# Pinned on 2/21/2016. Compatible with Vagrant 1.6.x?, 1.7.x? and 1.8.x.
|
24
|
+
gem 'vagrant-spec', :github => 'mitchellh/vagrant-spec', :ref => '9bba7e1'
|
26
25
|
end
|
27
26
|
|
28
27
|
eval_gemfile "#{__FILE__}.local" if File.exists? "#{__FILE__}.local"
|
@@ -23,6 +23,130 @@
|
|
23
23
|
# Implementing classes do not need to inherit from ConfigBuilder::Model::Base,
|
24
24
|
# but it makes life easier.
|
25
25
|
class ConfigBuilder::Model::Base
|
26
|
+
class << self
|
27
|
+
# Define the model identifier
|
28
|
+
#
|
29
|
+
# This method defines an entry in the data structure which is to be used as
|
30
|
+
# an identifier for generated model instances.
|
31
|
+
#
|
32
|
+
# @since 0.16.0
|
33
|
+
#
|
34
|
+
# @param identifier [Symbol]
|
35
|
+
#
|
36
|
+
# @return [Symbol] The identifier passed to `def_model_id`.
|
37
|
+
def def_model_id(identifier)
|
38
|
+
@model_id = identifier
|
39
|
+
end
|
40
|
+
|
41
|
+
# Fetch the model identifier
|
42
|
+
#
|
43
|
+
# @since 0.16.0
|
44
|
+
#
|
45
|
+
# @return [Symbol] The identifier defined using #{def_model_id}.
|
46
|
+
attr_reader :model_id
|
47
|
+
|
48
|
+
# Define a new model attribute
|
49
|
+
#
|
50
|
+
# Model attributes are used to configure Vagrant objects.
|
51
|
+
#
|
52
|
+
# @param identifier [Symbol]
|
53
|
+
#
|
54
|
+
# @return [Symbol] The identifier passed to `def_model_attribute`.
|
55
|
+
def def_model_attribute(identifier)
|
56
|
+
@model_attributes ||= []
|
57
|
+
|
58
|
+
@model_attributes << identifier
|
59
|
+
|
60
|
+
identifier
|
61
|
+
end
|
62
|
+
|
63
|
+
# Return all attributes defined for this model
|
64
|
+
#
|
65
|
+
# This method also returns inherited attributes.
|
66
|
+
#
|
67
|
+
# @return [Array<Symbol>] A list of model atttributes.
|
68
|
+
def model_attributes
|
69
|
+
@model_attributes ||= []
|
70
|
+
|
71
|
+
if (self < ::ConfigBuilder::Model::Base)
|
72
|
+
# This is a subclass of Model::Base
|
73
|
+
superclass.model_attributes + @model_attributes
|
74
|
+
else
|
75
|
+
@model_attributes
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# Define a new model option
|
80
|
+
#
|
81
|
+
# Model options are used when building new Vagrant objects.
|
82
|
+
#
|
83
|
+
# @param identifier [Symbol]
|
84
|
+
#
|
85
|
+
# @since 0.16.0
|
86
|
+
#
|
87
|
+
# @return [Symbol] The identifier passed to `def_model_option`.
|
88
|
+
def def_model_option(identifier)
|
89
|
+
@model_options ||= []
|
90
|
+
|
91
|
+
@model_options << identifier
|
92
|
+
|
93
|
+
identifier
|
94
|
+
end
|
95
|
+
|
96
|
+
# Return all options defined for this model
|
97
|
+
#
|
98
|
+
# This method also returns inherited options.
|
99
|
+
#
|
100
|
+
# @since 0.16.0
|
101
|
+
#
|
102
|
+
# @return [Array<Symbol>] A list of model options.
|
103
|
+
def model_options
|
104
|
+
@model_options ||= []
|
105
|
+
|
106
|
+
if (self < ::ConfigBuilder::Model::Base)
|
107
|
+
# This is a subclass of Model::Base
|
108
|
+
superclass.model_options + @model_options
|
109
|
+
else
|
110
|
+
@model_options
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
# Define a new model delegator
|
115
|
+
#
|
116
|
+
# Model delegators are used to hand configuration tasks off to other model
|
117
|
+
# classes.
|
118
|
+
#
|
119
|
+
# @param identifier [Symbol]
|
120
|
+
#
|
121
|
+
# @since 0.16.0
|
122
|
+
#
|
123
|
+
# @return [Symbol] The identifier passed to `def_model_delegator`.
|
124
|
+
def def_model_delegator(identifier)
|
125
|
+
@model_delegators ||= []
|
126
|
+
|
127
|
+
@model_delegators << identifier
|
128
|
+
|
129
|
+
identifier
|
130
|
+
end
|
131
|
+
|
132
|
+
# Return all delegators defined for this model
|
133
|
+
#
|
134
|
+
# This method also returns inherited delegators.
|
135
|
+
#
|
136
|
+
# @since 0.16.0
|
137
|
+
#
|
138
|
+
# @return [Array<Symbol>] A list of model delegators.
|
139
|
+
def model_delegators
|
140
|
+
@model_delegators ||= []
|
141
|
+
|
142
|
+
if (self < ::ConfigBuilder::Model::Base)
|
143
|
+
# This is a subclass of Model::Base
|
144
|
+
superclass.model_delegators + @model_delegators
|
145
|
+
else
|
146
|
+
@model_delegators
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
26
150
|
|
27
151
|
# Deserialize a hash into a configbuilder model
|
28
152
|
#
|
@@ -70,7 +194,6 @@ class ConfigBuilder::Model::Base
|
|
70
194
|
def attr(identifier)
|
71
195
|
@attrs[identifier]
|
72
196
|
end
|
73
|
-
private :attr
|
74
197
|
|
75
198
|
# Conditionally evaluate a block with a model attribute if it's defined
|
76
199
|
#
|
@@ -85,17 +208,68 @@ class ConfigBuilder::Model::Base
|
|
85
208
|
yield val
|
86
209
|
end
|
87
210
|
end
|
88
|
-
private :with_attr
|
89
211
|
|
90
|
-
|
212
|
+
def model_delegators
|
213
|
+
self.class.model_delegators
|
214
|
+
end
|
91
215
|
|
92
|
-
|
93
|
-
|
94
|
-
|
216
|
+
def eval_models(config)
|
217
|
+
model_delegators.each do |model|
|
218
|
+
meth = "eval_#{model}"
|
219
|
+
self.send(meth, config)
|
95
220
|
end
|
221
|
+
end
|
96
222
|
|
97
|
-
|
98
|
-
|
223
|
+
# Return the identifier value for this model instance
|
224
|
+
#
|
225
|
+
# @since 0.16.0
|
226
|
+
#
|
227
|
+
# @return [Object]
|
228
|
+
def instance_id
|
229
|
+
attr(self.class.model_id)
|
230
|
+
end
|
231
|
+
|
232
|
+
# Return a hash of all options which have been given a value
|
233
|
+
#
|
234
|
+
# This method returns a hash of options and their values. Options that were
|
235
|
+
# not present in the data used to create a model instance will not be
|
236
|
+
# returned.
|
237
|
+
#
|
238
|
+
# @since 0.16.0
|
239
|
+
#
|
240
|
+
# @return [Hash]
|
241
|
+
def instance_options
|
242
|
+
result = Hash.new
|
243
|
+
|
244
|
+
self.class.model_options.each do |id|
|
245
|
+
with_attr(id) {|val| result[id] = val}
|
246
|
+
end
|
247
|
+
|
248
|
+
result
|
249
|
+
end
|
250
|
+
|
251
|
+
# Copy attributes to a Vagrant configuration object
|
252
|
+
#
|
253
|
+
# This method iterates over each attribute defined via
|
254
|
+
# #{.def_model_attribute} and copies data to a Vagrant configuration object.
|
255
|
+
# By default, `config.attributename = value` is used. To provide custom
|
256
|
+
# behavior, define a `configure_attributename` method. This method will be
|
257
|
+
# passed the vagrant configuration object and the attribute value.
|
258
|
+
#
|
259
|
+
# @param [Vagrant.plugin('2', :config)] A Vagrant configuration object.
|
260
|
+
#
|
261
|
+
# @since 0.16.0
|
262
|
+
#
|
263
|
+
# @return [void]
|
264
|
+
def configure!(config)
|
265
|
+
self.class.model_attributes.each do |id|
|
266
|
+
if self.respond_to?("configure_#{id}")
|
267
|
+
# Call custom configuration method if defined.
|
268
|
+
with_attr(id) {|val| send("configure_#{id}", config, val)}
|
269
|
+
else
|
270
|
+
# 99% of the time, it's just config.thing = val
|
271
|
+
with_attr(id) {|val| config.send("#{id}=", val)}
|
272
|
+
end
|
99
273
|
end
|
100
274
|
end
|
101
275
|
end
|
@@ -3,35 +3,56 @@
|
|
3
3
|
# @see http://docs.vagrantup.com/v2/networking/forwarded_ports.html
|
4
4
|
class ConfigBuilder::Model::Network::ForwardedPort < ConfigBuilder::Model::Base
|
5
5
|
|
6
|
+
# @!attribute [rw] id
|
7
|
+
# @return [String, nil] An optional name used to identify this port forward
|
8
|
+
def_model_attribute :id
|
9
|
+
|
6
10
|
# @!attribute [rw] guest
|
7
|
-
# @return [Fixnum] The guest
|
11
|
+
# @return [Fixnum] The port on the guest that you want to be exposed on the
|
12
|
+
# host.
|
8
13
|
def_model_attribute :guest
|
9
14
|
|
15
|
+
# @!attribute [rw] guest_ip
|
16
|
+
# @return [String] The guest IP to bind the forwarded port to.
|
17
|
+
def_model_attribute :guest_ip
|
18
|
+
|
10
19
|
# @!attribute [rw] host
|
11
|
-
# @return [Fixnum] The host
|
20
|
+
# @return [Fixnum] The port on the host that you want to use to access the
|
21
|
+
# port on the guest.
|
12
22
|
def_model_attribute :host
|
13
23
|
|
24
|
+
# @!attribute [rw] host_ip
|
25
|
+
# @return [String] The IP on the host you want to bind the forwarded port to.
|
26
|
+
def_model_attribute :host_ip
|
27
|
+
|
28
|
+
# @!attribute [rw] protocol
|
29
|
+
# @return [String] Either `udp` or `tcp`. This specifies the protocol that
|
30
|
+
# will be allowed through the forwarded port. By default this is "tcp".
|
31
|
+
def_model_attribute :protocol
|
32
|
+
|
14
33
|
# @!attribute [rw] auto_correct
|
15
34
|
# @return [Boolean] Whether to automatically correct port collisions
|
16
35
|
def_model_attribute :auto_correct
|
17
36
|
|
18
|
-
# @!attribute [rw] id
|
19
|
-
# @return [String, nil] An optional name used to identify this port forward
|
20
|
-
def_model_attribute :id
|
21
|
-
|
22
37
|
def initialize
|
23
38
|
@defaults = {:auto_correct => false, :id => nil}
|
24
39
|
end
|
25
40
|
|
26
41
|
def to_proc
|
27
42
|
Proc.new do |vm_config|
|
28
|
-
vm_config.network(
|
29
|
-
:forwarded_port,
|
30
|
-
:guest => attr(:guest),
|
31
|
-
:host => attr(:host),
|
32
|
-
:auto_correct => attr(:auto_correct),
|
33
|
-
:id => attr(:id),
|
34
|
-
)
|
43
|
+
vm_config.network(:forwarded_port, forwarded_port_opts)
|
35
44
|
end
|
36
45
|
end
|
46
|
+
|
47
|
+
def forwarded_port_opts
|
48
|
+
h = {}
|
49
|
+
with_attr(:id) { |val| h[:id] = val }
|
50
|
+
with_attr(:guest) { |val| h[:guest] = val }
|
51
|
+
with_attr(:guest_ip) { |val| h[:guest_ip] = val }
|
52
|
+
with_attr(:host) { |val| h[:host] = val }
|
53
|
+
with_attr(:host_ip) { |val| h[:host_ip] = val }
|
54
|
+
with_attr(:protocol) { |val| h[:protocol] = val }
|
55
|
+
with_attr(:auto_correct) { |val| h[:auto_correct] = val }
|
56
|
+
h
|
57
|
+
end
|
37
58
|
end
|
@@ -4,11 +4,27 @@
|
|
4
4
|
class ConfigBuilder::Model::Network::PrivateNetwork < ConfigBuilder::Model::Base
|
5
5
|
|
6
6
|
# @!attribute [rw] :ip
|
7
|
-
# @return [String] The IP address to use for the private network interface
|
7
|
+
# @return [String] The IP address to use for the private network interface.
|
8
8
|
def_model_attribute :ip
|
9
9
|
|
10
|
+
# @!attribute [rw] :netmask
|
11
|
+
# @return [String] The netmask to use for the private network interface.
|
12
|
+
def_model_attribute :netmask
|
13
|
+
|
14
|
+
# @!attribute [rw] :type
|
15
|
+
# @return [String]
|
16
|
+
def_model_attribute :type
|
17
|
+
|
18
|
+
# @!attribute [rw] :auto_config
|
19
|
+
# @return [Boolean]
|
20
|
+
def_model_attribute :auto_config
|
21
|
+
|
10
22
|
def to_proc
|
11
23
|
Proc.new do |vm_config|
|
24
|
+
# NOTE: @attrs _must_ be used here to preserve compatibility with the
|
25
|
+
# vagrant-auto_network plugin.
|
26
|
+
# FIXME: Re-factor attribute handling so that this sort of magic isn't
|
27
|
+
# necessary.
|
12
28
|
vm_config.network(:private_network, @attrs)
|
13
29
|
end
|
14
30
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# Vagrant public network
|
2
|
+
#
|
3
|
+
# @see http://docs.vagrantup.com/v2/networking/public_network.html
|
4
|
+
class ConfigBuilder::Model::Network::PublicNetwork < ConfigBuilder::Model::Base
|
5
|
+
|
6
|
+
# @!attribute [rw] :ip
|
7
|
+
# @return [String] The IP address to use for the public network interface.
|
8
|
+
def_model_attribute :ip
|
9
|
+
|
10
|
+
# @!attribute [rw] :bridge
|
11
|
+
# @return [String, Array<String>] If more than one network interface is
|
12
|
+
# available on the host machine, Vagrant will ask you to choose which interface
|
13
|
+
# the virtual machine should bridge to. A default interface can be specified by
|
14
|
+
# adding a :bridge clause to the network definition.
|
15
|
+
def_model_attribute :bridge
|
16
|
+
|
17
|
+
# @!attribute [rw] :use_dhcp_assigned_default_route
|
18
|
+
# @return [Boolean]
|
19
|
+
def_model_attribute :use_dhcp_assigned_default_route
|
20
|
+
|
21
|
+
# @!attribute [rw] :auto_config
|
22
|
+
# @return [Boolean]
|
23
|
+
def_model_attribute :auto_config
|
24
|
+
|
25
|
+
def to_proc
|
26
|
+
Proc.new do |vm_config|
|
27
|
+
vm_config.network(:public_network, public_network_opts)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def public_network_opts
|
32
|
+
h = {}
|
33
|
+
with_attr(:ip) { |val| h[:ip] = val }
|
34
|
+
with_attr(:use_dhcp_assigned_default_route) { |val| h[:use_dhcp_assigned_default_route] = val }
|
35
|
+
with_attr(:bridge) { |val| h[:bridge] = val }
|
36
|
+
with_attr(:auto_config) { |val| h[:auto_config] = val }
|
37
|
+
h
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# Vagrant NFS model
|
2
|
+
#
|
3
|
+
# @see https://docs.vagrantup.com/v2/synced-folders/nfs.html
|
4
|
+
class ConfigBuilder::Model::NFS < ConfigBuilder::Model::Base
|
5
|
+
# @!attribute [rw] functional
|
6
|
+
# @return [Boolean] If false, then NFS will not be used as a synced folder
|
7
|
+
# type.
|
8
|
+
def_model_attribute :functional
|
9
|
+
|
10
|
+
# @!attribute [rw] map_uid
|
11
|
+
# @return [Fixnum] The UID to map all read/write requests to.
|
12
|
+
def_model_attribute :map_uid
|
13
|
+
|
14
|
+
# @!attribute [rw] map_gid
|
15
|
+
# @return [Fixnum] The GID to map all read/write requests to.
|
16
|
+
def_model_attribute :map_gid
|
17
|
+
|
18
|
+
# @!attribute [rw] verify_installed
|
19
|
+
# @return [Boolean] If this is false, then Vagrant will skip checking if NFS
|
20
|
+
# is installed.
|
21
|
+
def_model_attribute :verify_installed
|
22
|
+
|
23
|
+
def to_proc
|
24
|
+
Proc.new do |global_config|
|
25
|
+
nfs = global_config.nfs
|
26
|
+
|
27
|
+
with_attr(:functional) { |val| nfs.functional = val }
|
28
|
+
with_attr(:map_uid) { |val| nfs.map_uid = val }
|
29
|
+
with_attr(:map_gid) { |val| nfs.map_gid = val }
|
30
|
+
with_attr(:verify_installed) { |val| nfs.verify_installed = val }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
#
|
3
3
|
# @see https://github.com/mitchellh/vagrant-aws/blob/master/README.md#configuration
|
4
4
|
# @since 0.15.0
|
5
|
-
class ConfigBuilder::Model::Provider::Aws < ConfigBuilder::Model::Base
|
5
|
+
class ConfigBuilder::Model::Provider::Aws < ConfigBuilder::Model::Provider::Base
|
6
6
|
|
7
7
|
def_model_attribute :access_key_id
|
8
8
|
def_model_attribute :ami
|
@@ -12,58 +12,35 @@ class ConfigBuilder::Model::Provider::Aws < ConfigBuilder::Model::Base
|
|
12
12
|
def_model_attribute :instance_package_timeout
|
13
13
|
def_model_attribute :instance_type
|
14
14
|
def_model_attribute :keypair_name
|
15
|
-
def_model_attribute :session_token
|
16
15
|
def_model_attribute :private_ip_address
|
17
16
|
def_model_attribute :elastic_ip
|
18
17
|
def_model_attribute :region
|
18
|
+
def_model_attribute :endpoint
|
19
|
+
def_model_attribute :version
|
19
20
|
def_model_attribute :secret_access_key
|
21
|
+
def_model_attribute :session_token
|
20
22
|
def_model_attribute :security_groups
|
21
23
|
def_model_attribute :iam_instance_profile_arn
|
24
|
+
def_model_attribute :iam_instance_profile_name
|
22
25
|
def_model_attribute :subnet_id
|
23
|
-
def_model_attribute :associate_public_ip
|
24
|
-
def_model_attribute :ssh_host_attribute
|
25
26
|
def_model_attribute :tags
|
26
27
|
def_model_attribute :package_tags
|
27
28
|
def_model_attribute :use_iam_profile
|
29
|
+
def_model_attribute :user_data
|
28
30
|
def_model_attribute :block_device_mapping
|
31
|
+
def_model_attribute :terminate_on_shutdown
|
32
|
+
def_model_attribute :ssh_host_attribute
|
33
|
+
def_model_attribute :monitoring
|
34
|
+
def_model_attribute :elb_optimized
|
35
|
+
def_model_attribute :source_dest_check
|
36
|
+
def_model_attribute :associate_public_ip
|
29
37
|
def_model_attribute :elb
|
30
38
|
def_model_attribute :unregister_elb_from_az
|
31
|
-
def_model_attribute :
|
32
|
-
|
33
|
-
def initialize
|
34
|
-
@defaults = {}
|
35
|
-
end
|
39
|
+
def_model_attribute :kernel_id
|
40
|
+
def_model_attribute :tenancy
|
36
41
|
|
37
|
-
def
|
38
|
-
|
39
|
-
vm_config.provider 'aws' do |config|
|
40
|
-
with_attr(:access_key_id) { |val| config.access_key_id = val }
|
41
|
-
with_attr(:ami) { |val| config.ami = val }
|
42
|
-
with_attr(:availability_zone) { |val| config.availability_zone = val }
|
43
|
-
with_attr(:instance_ready_timeout) { |val| config.instance_ready_timeout = val }
|
44
|
-
with_attr(:instance_check_interval) { |val| config.instance_check_interval = val }
|
45
|
-
with_attr(:instance_package_timeout) { |val| config.instance_package_timeout = val }
|
46
|
-
with_attr(:instance_type) { |val| config.instance_type = val }
|
47
|
-
with_attr(:keypair_name) { |val| config.keypair_name = val }
|
48
|
-
with_attr(:session_token) { |val| config.session_token = val }
|
49
|
-
with_attr(:private_ip_address) { |val| config.private_ip_address = val }
|
50
|
-
with_attr(:elastic_ip) { |val| config.elastic_ip = val }
|
51
|
-
with_attr(:region) { |val| config.region = val }
|
52
|
-
with_attr(:secret_access_key) { |val| config.secret_access_key = val }
|
53
|
-
with_attr(:security_groups) { |val| config.security_groups = val }
|
54
|
-
with_attr(:iam_instance_profile_arn) { |val| config.iam_instance_profile_arn = val }
|
55
|
-
with_attr(:subnet_id) { |val| config.subnet_id = val }
|
56
|
-
with_attr(:associate_public_ip) { |val| config.associate_public_ip = val }
|
57
|
-
with_attr(:ssh_host_attribute) { |val| config.ssh_host_attribute = val }
|
58
|
-
with_attr(:tags) { |val| config.tags = val }
|
59
|
-
with_attr(:package_tags) { |val| config.package_tags = val }
|
60
|
-
with_attr(:use_iam_profile) { |val| config.use_iam_profile = val }
|
61
|
-
with_attr(:block_device_mapping) { |val| config.block_device_mapping = val }
|
62
|
-
with_attr(:elb) { |val| config.elb = val }
|
63
|
-
with_attr(:unregister_elb_from_az) { |val| config.unregister_elb_from_az = val }
|
64
|
-
with_attr(:terminate_on_shutdown) { |val| config.terminate_on_shutdown = val }
|
65
|
-
end
|
66
|
-
end
|
42
|
+
def instance_id
|
43
|
+
'aws'
|
67
44
|
end
|
68
45
|
|
69
46
|
ConfigBuilder::Model::Provider.register('aws', self)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# @see https://github.com/MSOpenTech/vagrant-azure
|
2
|
-
class ConfigBuilder::Model::Provider::Azure < ConfigBuilder::Model::Base
|
2
|
+
class ConfigBuilder::Model::Provider::Azure < ConfigBuilder::Model::Provider::Base
|
3
3
|
|
4
4
|
def_model_attribute :mgmt_certificate
|
5
5
|
def_model_attribute :mgmt_endpoint
|
@@ -13,12 +13,20 @@ class ConfigBuilder::Model::Provider::Azure < ConfigBuilder::Model::Base
|
|
13
13
|
def_model_attribute :vm_image
|
14
14
|
def_model_attribute :vm_location
|
15
15
|
def_model_attribute :vm_affinity_group
|
16
|
+
def_model_attribute :vm_virtual_network_name
|
16
17
|
|
17
18
|
def_model_attribute :cloud_service_name
|
18
19
|
def_model_attribute :deployment_name
|
19
20
|
def_model_attribute :tcp_endpoints
|
21
|
+
|
22
|
+
# ssh_private_key and ssh_certificate_file is overly specific and probably should be deprecated in favor of
|
23
|
+
# private_key_file and certificate_file as they are in Azure ruby sdk.
|
24
|
+
# This is here to not break compatibility with previous versions.
|
25
|
+
def_model_attribute :private_key_file
|
20
26
|
def_model_attribute :ssh_private_key_file
|
27
|
+
def_model_attribute :certificate_file
|
21
28
|
def_model_attribute :ssh_certificate_file
|
29
|
+
|
22
30
|
def_model_attribute :ssh_port
|
23
31
|
def_model_attribute :vm_size
|
24
32
|
def_model_attribute :winrm_transport
|
@@ -28,38 +36,8 @@ class ConfigBuilder::Model::Provider::Azure < ConfigBuilder::Model::Base
|
|
28
36
|
|
29
37
|
def_model_attribute :state_read_timeout
|
30
38
|
|
31
|
-
def
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
def to_proc
|
36
|
-
Proc.new do |vm_config|
|
37
|
-
vm_config.provider 'azure' do |config|
|
38
|
-
with_attr(:mgmt_certificate) { |val| config.mgmt_certificate = val }
|
39
|
-
with_attr(:mgmt_endpoint) { |val| config.mgmt_endpoint = val }
|
40
|
-
with_attr(:subscription_id) { |val| config.subscription_id = val }
|
41
|
-
with_attr(:storage_acct_name) { |val| config.storage_acct_name = val }
|
42
|
-
with_attr(:storage_access_key) { |val| config.storage_access_key = val }
|
43
|
-
with_attr(:vm_name) { |val| config.vm_name = val }
|
44
|
-
with_attr(:vm_user) { |val| config.vm_user = val }
|
45
|
-
with_attr(:vm_password) { |val| config.vm_password = val }
|
46
|
-
with_attr(:vm_image) { |val| config.vm_image = val }
|
47
|
-
with_attr(:vm_location) { |val| config.vm_location = val }
|
48
|
-
with_attr(:vm_affinity_group) { |val| config.vm_affinity_group = val }
|
49
|
-
with_attr(:cloud_service_name) { |val| config.cloud_service_name = val }
|
50
|
-
with_attr(:deployment_name) { |val| config.deployment_name = val }
|
51
|
-
with_attr(:tcp_endpoints) { |val| config.tcp_endpoints = val }
|
52
|
-
with_attr(:ssh_private_key_file) { |val| config.ssh_private_key_file = val }
|
53
|
-
with_attr(:ssh_certificate_file) { |val| config.ssh_certificate_file = val }
|
54
|
-
with_attr(:ssh_port) { |val| config.ssh_port = val }
|
55
|
-
with_attr(:vm_size) { |val| config.vm_size = val }
|
56
|
-
with_attr(:winrm_transport) { |val| config.winrm_transport = val }
|
57
|
-
with_attr(:winrm_http_port) { |val| config.winrm_http_port = val }
|
58
|
-
with_attr(:winrm_https_port) { |val| config.winrm_https_port = val }
|
59
|
-
with_attr(:availability_set_name) { |val| config.availability_set_name = val }
|
60
|
-
with_attr(:state_read_timeout) { |val| config.state_read_timeout = val }
|
61
|
-
end
|
62
|
-
end
|
39
|
+
def instance_id
|
40
|
+
'azure'
|
63
41
|
end
|
64
42
|
|
65
43
|
ConfigBuilder::Model::Provider.register('azure', self)
|