vagrant-config_builder 0.10.1 → 0.11.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad642e21b08ad1ad7baf002cd01ec1167758a332
4
- data.tar.gz: 8f473ceb06a835407c996de34a96c609ab8a0cc0
3
+ metadata.gz: b242f323d273ed6a555d016d2281609563d28620
4
+ data.tar.gz: badb6da19a3ec43aea229f162ea616b5e04be7c5
5
5
  SHA512:
6
- metadata.gz: 8cc9a6ba0eeb0dff69ff001b477b5e4473c072d29ca76f554840a630bdd6cd348df9562d80d645954ff846dbbb365bee82b55bd890b3104b6c62c0525822a443
7
- data.tar.gz: ed2c49b370655683309dbffe8cabc7b38bb505ed68e4f92eda5e6a4722d43878a3294a37d50fbd03e5105f23fc39e5ec5e11cd937c99de5d1f7be095238fab17
6
+ metadata.gz: c78a02cc55ebf0fc674ca2cc3e0038350fd3ffacdd55bbaa659c18e88dcf008f630ba3e1bf9c8c48c07ef3e442383815edac8393582b6a44c34772b7210a940a
7
+ data.tar.gz: ab497c2f941c60880b6aafa1c586dda6d3f4acfe3a4c6f762d8f8506f7c3066223a9ff89786160796924fc692479b0b60cb701f285992304b2602cc453e7fc49
data/CHANGELOG CHANGED
@@ -1,6 +1,24 @@
1
1
  CHANGELOG
2
2
  =========
3
3
 
4
+ 0.11.0
5
+ ------
6
+
7
+ 2014-09-17
8
+
9
+ This is a backwards feature release.
10
+
11
+ * (GH-23) Fix misspelling of `disabled` option for synced folders.
12
+
13
+ * (GH-26) Enable configuration of global WinRM options.
14
+
15
+ * Enable configuration of global SSH options.
16
+
17
+ * Enable configuration of additional box download options such as
18
+ checksumming and versioning.
19
+
20
+ Thanks to Nan Liu and Ethan Brown for their contributions to this release.
21
+
4
22
  0.10.1
5
23
  ------
6
24
 
@@ -6,9 +6,27 @@ class ConfigBuilder::Model::Root < ConfigBuilder::Model::Base
6
6
  include ConfigBuilder::ModelDelegator
7
7
 
8
8
  def_model_delegator :vagrant
9
- def_model_delegator :ssh
10
9
  def_model_delegator :vms
11
10
 
11
+ # @!attribute [rw] ssh
12
+ # @return [Hash<Symbol, Object>] The ssh configuration for all VMs
13
+ # @example
14
+ # >> config.ssh
15
+ # => {
16
+ # :username => 'administrator',
17
+ # :password => 'vagrant',
18
+ # }
19
+ def_model_delegator :ssh
20
+
21
+ # @!attribute [rw] winrm
22
+ # @return [Hash<Symbol, Object>] The winrm configuration for all VMs
23
+ # @example
24
+ # >> config.winrm
25
+ # => {
26
+ # :username => 'administrator',
27
+ # :password => 'vagrant',
28
+ # }
29
+ def_model_delegator :winrm
12
30
 
13
31
  def initialize
14
32
  @defaults = {:vms => [], :vagrant => {}}
@@ -36,6 +54,16 @@ class ConfigBuilder::Model::Root < ConfigBuilder::Model::Base
36
54
  end
37
55
 
38
56
  def eval_ssh(root_config)
57
+ with_attr(:ssh) do |ssh_config|
58
+ f = ConfigBuilder::Model::SSH.new_from_hash(ssh_config)
59
+ f.call(root_config)
60
+ end
61
+ end
39
62
 
63
+ def eval_winrm(root_config)
64
+ if attr(:winrm)
65
+ f = ConfigBuilder::Model::WinRM.new_from_hash(attr(:winrm))
66
+ f.call(root_config)
67
+ end
40
68
  end
41
69
  end
@@ -1,10 +1,110 @@
1
+ # Vagrant SSH credential model
2
+ #
1
3
  # @see http://docs.vagrantup.com/v2/vagrantfile/ssh_settings.html
2
4
  class ConfigBuilder::Model::SSH < ConfigBuilder::Model::Base
5
+ # @!attribute [rw] username
6
+ # @return [String] This sets the username that Vagrant will SSH as by
7
+ # default. Providers are free to override this if they detect a more
8
+ # appropriate user. By default this is "vagrant," since that is what most
9
+ # public boxes are made as.
10
+ def_model_attribute :username
11
+
12
+ # @!attribute [rw] password
13
+ # @return [String] This sets a password that Vagrant will use to
14
+ # authenticate the SSH user. Note that Vagrant recommends you use
15
+ # key-based authentiation rather than a password (see #private_key_path)
16
+ # below. If you use a password, Vagrant will automatically insert a
17
+ # keypair if `insert_key` is true.
18
+ def_model_attribute :password
19
+
20
+ # @!attribute [rw] host
21
+ # @return [String] The hostname or IP to SSH into. By default this is
22
+ # empty, because the provider usually figures this out for you.
23
+ def_model_attribute :host
24
+
25
+ # @!attribute [rw] port
26
+ # @return [Fixnum] The port to SSH into. By default this is port 22.
27
+ def_model_attribute :port
28
+
3
29
  # @!attribute [rw] guest_port
4
- # @!attribute [rw] keepalive
5
- # @!attribute [rw] max_tries
6
- # @!attribute [rw] timeout
7
- # @!attribute [rw] forward_x11
30
+ # @return [Fixnum] The port on the guest that SSH is running on. This is
31
+ # used by some providers to detect forwarded ports for SSH. For example,
32
+ # if this is set to 22 (the default), and Vagrant detects a forwarded
33
+ # port to port 22 on the guest from port 4567 on the host, Vagrant will
34
+ # attempt to use port 4567 to talk to the guest if there is no other
35
+ # option.
36
+ def_model_attribute :guest_port
37
+
38
+ # @!attribute [rw] private_key_path
39
+ # @return [String] The path to the private key to use to SSH into the guest
40
+ # machine. By default this is the insecure private key that ships with
41
+ # Vagrant, since that is what public boxes use. If you make your own
42
+ # custom box with a custom SSH key, this should point to that private
43
+ # key.
44
+ #
45
+ # You can also specify multiple private keys by setting this to be an
46
+ # array. This is useful, for example, if you use the default private key
47
+ # to bootstrap the machine, but replace it with perhaps a more secure key
48
+ # later.
49
+ def_model_attribute :private_key_path
50
+
8
51
  # @!attribute [rw] forward_agent
52
+ # @return [Boolean] If `true`, agent forwarding over SSH connections is
53
+ # enabled. Defaults to `false`.
54
+ def_model_attribute :forward_agent
55
+
56
+ # @!attribute [rw] forward_x11
57
+ # @return [Boolean] If `true`, X11 forwarding over SSH connections is
58
+ # enabled. Defaults to `false`.
59
+ def_model_attribute :forward_x11
60
+
61
+ # @!attribute [rw] insert_key
62
+ # @return [Boolean] If `true`, Vagrant will automatically insert an insecure
63
+ # keypair to use for SSH. By default, this is `true`. This only has an
64
+ # effect if you don't already use private keys for authentication.
65
+ def_model_attribute :insert_key
66
+
67
+ # @!attribute [rw] proxy_command
68
+ # @return [String] A command-line command to execute that receives the data
69
+ # to send to SSH on stdin. This can be used to proxy the SSH connection.
70
+ # `%h` in the command is replaced with the host and `%p` is replaced with
71
+ # the port.
72
+ def_model_attribute :proxy_command
73
+
74
+ # @!attribute [rw] pty
75
+ # @return [Boolean] If `true`, pty will be used for provisioning. Defaults
76
+ # to `false`.
77
+ #
78
+ # This setting is an _advanced feature_ that should not be enabled unless
79
+ # absolutely necessary. It breaks some other features of Vagrant, and is
80
+ # really only exposed for cases where it is absolutely necessary. If you
81
+ # can find a way to not use a pty, that is recommended instead.
82
+ def_model_attribute :pty
83
+
9
84
  # @!attribute [rw] shell
85
+ # @return [String] The shell to use when executing SSH commands from
86
+ # Vagrant. By default this is `bash -l`. Note that this has no effect on
87
+ # the shell you get when you run `vagrant ssh`. This configuration option
88
+ # only affects the shell to use when executing commands internally in
89
+ # Vagrant.
90
+ def_model_attribute :shell
91
+
92
+ def to_proc
93
+ Proc.new do |global_config|
94
+ ssh = global_config.ssh
95
+
96
+ with_attr(:username) { |val| ssh.username = val }
97
+ with_attr(:password) { |val| ssh.password = val }
98
+ with_attr(:host) { |val| ssh.host = val }
99
+ with_attr(:port) { |val| ssh.port = val }
100
+ with_attr(:guest_port) { |val| ssh.guest_port = val }
101
+ with_attr(:private_key_path) { |val| ssh.private_key_path = val }
102
+ with_attr(:forward_agent) { |val| ssh.forward_agent = val }
103
+ with_attr(:forward_x11) { |val| ssh.forward_x11 = val }
104
+ with_attr(:insert_key) { |val| ssh.insert_key = val }
105
+ with_attr(:proxy_command) { |val| ssh.proxy_command = val }
106
+ with_attr(:pty) { |val| ssh.pty = val }
107
+ with_attr(:shell) { |val| ssh.shell = val }
108
+ end
109
+ end
10
110
  end
@@ -35,7 +35,7 @@ class ConfigBuilder::Model::SyncedFolder < ConfigBuilder::Model::Base
35
35
  def folder_opts
36
36
  h = {}
37
37
  with_attr(:extra) { |val| h[:extra] = val }
38
- with_attr(:disable) { |val| h[:disabled] = val }
38
+ with_attr(:disabled) { |val| h[:disabled] = val }
39
39
  with_attr(:nfs) { |val| h[:nfs] = val }
40
40
 
41
41
  h
@@ -73,18 +73,75 @@ class ConfigBuilder::Model::VM < ConfigBuilder::Model::Base
73
73
  #
74
74
  def_model_delegator :synced_folders
75
75
 
76
- # @!attribute [rw] box
77
- # @return [String] The name of the Vagrant box to instantiate for this VM
78
- def_model_attribute :box
79
-
80
76
  # @!attribute [rw] guest
81
77
  # @return [String] The guest type to use for this VM
82
78
  def_model_attribute :guest
83
79
 
84
- # @!attribute [rw] box_url
85
- # @return [String] The source URL for the Vagrant box associated with this VM
80
+ # @!attribute [rw] box
81
+ # @return [String] This configures what box the machine will be brought up
82
+ # against. The value here should be the name of an installed box or a
83
+ # shorthand name of a box in Vagrant Cloud.
86
84
  def_model_attribute :box
87
85
 
86
+ # @!attribute [rw] box_url
87
+ # @return [String, Array<String>] The URL that the configured box can be
88
+ # found at. If `box` is a shorthand to a box in Vagrant Cloud then this
89
+ # value doesn't need to be specified. Otherwise, it should point to the
90
+ # proper place where the box can be found if it isn't installed.
91
+ #
92
+ # This can also be an array of multiple URLs. The URLs will be tried in
93
+ # order. Note that any client certificates, insecure download settings,
94
+ # and so on will apply to all URLs in this list.
95
+ #
96
+ # The URLs can also be local files by using the file:// scheme. For
97
+ # example: "file:///tmp/test.box".
98
+ def_model_attribute :box_url
99
+
100
+ # @!attribute [rw] box_download_checksum
101
+ # @return [String] The checksum of the box specified by `box_url`.
102
+ # If not specified, no checksum comparison will be done. If specified,
103
+ # Vagrant will compare the checksum of the downloaded box to this value
104
+ # and error if they do not match. Checksum checking is only done when
105
+ # Vagrant must download the box.
106
+ #
107
+ # If this is specified, then `box_download_checksum_type` must also be
108
+ # specified.
109
+ def_model_attribute :box_download_checksum
110
+
111
+ # @!attribute [rw] box_download_checksum_type
112
+ # @return [String] The type of checksum specified by
113
+ # `box_download_checksum` (if any). Supported values are currently `md5`,
114
+ # `sha1`, and `sha256`.
115
+ def_model_attribute :box_download_checksum_type
116
+
117
+ # @!attribute [rw] box_download_client_cert
118
+ # @return [String] Path to a client certificate to use when downloading the
119
+ # box, if it is necessary. By default, no client certificate is used to
120
+ # download the box.
121
+ def_model_attribute :box_download_client_cert
122
+
123
+ # @!attribute [rw] box_download_insecure
124
+ # @return [Boolean] If `true`, then SSL certificates from the server will
125
+ # not be verified. By default, if the URL is an HTTPS URL, then SSL certs
126
+ # will be verified.
127
+ def_model_attribute :box_download_insecure
128
+
129
+ # @!attribute [rw] box_check_update
130
+ # @return [Boolean] If true, Vagrant will check for updates to the
131
+ # configured box on every `vagrant up`. If an update is found, Vagrant
132
+ # will tell the user. By default this is `true`. Updates will only be
133
+ # checked for boxes that properly support updates (boxes from Vagrant
134
+ # Cloud or some other versioned box).
135
+ def_model_attribute :box_check_update
136
+
137
+ # @!attribute [rw] box_version
138
+ # @return [String] The version of the box to use. This defaults to ">= 0"
139
+ # (the latest version available). This can contain an arbitrary list of
140
+ # constraints, separated by commas, such as: >= 1.0, < 1.5. When
141
+ # constraints are given, Vagrant will use the latest available box
142
+ # satisfying these constraints.
143
+ def_model_attribute :box_version
144
+
88
145
  # @!attribute [rw] name
89
146
  # @return [String] The name of the instantiated box in this environment
90
147
  def_model_attribute :name
@@ -113,8 +170,15 @@ class ConfigBuilder::Model::VM < ConfigBuilder::Model::Base
113
170
  global_config.vm.define(attr(:name)) do |config|
114
171
  vm_config = config.vm
115
172
 
116
- with_attr(:box) { |val| vm_config.box = attr(:box) }
117
- with_attr(:box_url) { |val| vm_config.box_url = attr(:box_url) }
173
+ with_attr(:box) { |val| vm_config.box = val }
174
+ with_attr(:box_url) { |val| vm_config.box_url = val }
175
+ with_attr(:box_download_checksum) { |val| vm_config.box_download_checksum = val }
176
+ with_attr(:box_download_checksum_type) { |val| vm_config.box_download_checksum_type = val }
177
+ with_attr(:box_download_client_cert) { |val| vm_config.box_download_client_cert = val }
178
+ with_attr(:box_download_insecure) { |val| vm_config.box_download_insecure = val }
179
+ with_attr(:box_check_update) { |val| vm_config.box_check_update = val }
180
+ with_attr(:box_version) { |val| vm_config.box_version = val }
181
+
118
182
  with_attr(:hostname) { |val| vm_config.hostname = attr(:hostname) }
119
183
  with_attr(:guest) { |val| vm_config.guest = attr(:guest) }
120
184
 
@@ -0,0 +1,56 @@
1
+ # Vagrant WinRM credential model.
2
+ #
3
+ # @see http://docs.vagrantup.com/v2/vagrantfile
4
+ class ConfigBuilder::Model::WinRM < ConfigBuilder::Model::Base
5
+ # @!attribute [rw] username
6
+ # @return [String] This sets the username that Vagrant will WinRM as by
7
+ # default. Providers are free to override this if they detect a more
8
+ # appropriate user. By default this is "vagrant," since that is what most
9
+ # public boxes are made as.
10
+ def_model_attribute :username
11
+
12
+ # @!attribute [rw] password
13
+ # @return [String] This sets a password that Vagrant will use to
14
+ # authenticate the WinRM user.
15
+ def_model_attribute :password
16
+
17
+ # @!attribute [rw] host
18
+ # @return [String] The hostname or IP to WinRM into. By default this is
19
+ # empty, because the provider usually figures this out for you.
20
+ def_model_attribute :host
21
+
22
+ # @!attribute [rw] port
23
+ # @return [Fixnum] The port to WinRM into. By default this is port 5985.
24
+ def_model_attribute :port
25
+
26
+ # @!attribute [rw] guest_port
27
+ # @return [Fixnum] The port on the guest that WinRM is running on.
28
+ # This is used by some providers to detect forwarded ports for WinRM.
29
+ # For example, if this is set to 5985 (the default), and Vagrant detects
30
+ # a forwarded port to port 5985 on the guest from port 4567 on the host,
31
+ # Vagrant will attempt to use port 4567 to talk to the guest if there is
32
+ # no other option.
33
+ def_model_attribute :guest_port
34
+
35
+ # @!attribute [rw] max_tries
36
+ # @return [Fixnum] Maximum number of retry attempts. By default this is 20.
37
+ def_model_attribute :max_tries
38
+
39
+ # @!attribute [rw] timeout
40
+ # @return [Fixnum] The timeout in seconds. By default this is 1800 seconds.
41
+ def_model_attribute :timeout
42
+
43
+ def to_proc
44
+ Proc.new do |global_config|
45
+ winrm = global_config.winrm
46
+
47
+ with_attr(:username) { |val| winrm.username = val }
48
+ with_attr(:password) { |val| winrm.password = val }
49
+ with_attr(:host) { |val| winrm.host = val }
50
+ with_attr(:guest) { |val| winrm.guest = val }
51
+ with_attr(:guest_port) { |val| winrm.guest_port = val }
52
+ with_attr(:max_tries) { |val| winrm.max_tries = val }
53
+ with_attr(:timeout) { |val| winrm.timeout = val }
54
+ end
55
+ end
56
+ end
@@ -11,6 +11,7 @@ module ConfigBuilder
11
11
  require 'config_builder/model/root'
12
12
 
13
13
  require 'config_builder/model/ssh'
14
+ require 'config_builder/model/winrm'
14
15
  #require 'config_builder/model/host'
15
16
 
16
17
  require 'config_builder/model/vm'
@@ -1,3 +1,3 @@
1
1
  module ConfigBuilder
2
- VERSION = '0.10.1'
2
+ VERSION = '0.11.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-config_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrien Thebo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-08 00:00:00.000000000 Z
11
+ date: 2014-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: deep_merge
@@ -77,6 +77,7 @@ files:
77
77
  - lib/config_builder/model/ssh.rb
78
78
  - lib/config_builder/model/synced_folder.rb
79
79
  - lib/config_builder/model/vm.rb
80
+ - lib/config_builder/model/winrm.rb
80
81
  - lib/config_builder/model_delegator.rb
81
82
  - lib/config_builder/plugin.rb
82
83
  - lib/config_builder/runner.rb