vagrant-managed-servers 0.6.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 642be23bb2dc3eae5795ff4916dc95d061d8a886
4
- data.tar.gz: f35c644748e1ad9fba5a7f62b7efa019b23bdf59
3
+ metadata.gz: 7af13283657a3d769ae1cc914ce9fba26b821f9e
4
+ data.tar.gz: 2dd6a83ed804003cc01c3002414c6394a003c609
5
5
  SHA512:
6
- metadata.gz: c6e9125a1770c924679aa18c71dc384ba0d9ae285aa202a4e625e933fb49b0f9cd76b4ba3ae3f1d0f6ef05e27b0a590ddbd5399ecbeb7fccae509fa755e7b87a
7
- data.tar.gz: 0f8f5a8e007d996fea2c627ff7f6824377a18108169b7edd1b9a82720c94fd698cc24520839ec914015982ee8328e67add9a5d4dab7dff6019467d5fb81d63bf
6
+ metadata.gz: a67a524ffd92a39588970e47945cc664045ee2368e5426b70e756297968dedf68b30ba6c904f03ed98e42d1c823dec1d5d2cb0431a52ced607079c4114d12dc1
7
+ data.tar.gz: 5fe6c439253f17e6451bd4b64601626323f941f2dbdb5e6a9c0cf00ee1125c4841f1a05d4dcf97610f9da0bc155f182a70e047d0fbf31d6f1162f58247295529
data/Berksfile CHANGED
@@ -1,4 +1,4 @@
1
- source "https://supermarket.getchef.com"
1
+ source "https://supermarket.chef.io"
2
2
 
3
3
  cookbook 'apt'
4
- cookbook 'apache2'
4
+ cookbook 'apache2'
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
 
2
2
  # Changelog
3
3
 
4
+ ## 0.7.0 (released 2015-05-22)
5
+
6
+ * extract the WinRM synced folder mechanism into [a separate plugin](https://github.com/Cimpress-MCP/vagrant-winrm-syncedfolders) (see [#47](https://github.com/tknerr/vagrant-managed-servers/pull/47), thanks @chrisbaldauf!)
7
+ * use the `Vagrant::Action::Builtin::SyncedFolders` for provisioning windows guests. This will use (the much faster) SMB synced folders if possible (see [README](https://github.com/tknerr/vagrant-managed-servers#synced-folders-windows)), otherwise fall back to the WinRM implementation above (see [#46](https://github.com/tknerr/vagrant-managed-servers/issues/46), thanks @chrisbaldauf!)
8
+ * clean up the example Vagrantfile and add windows examples [#48](https://github.com/tknerr/vagrant-managed-servers/pull/48)
9
+
4
10
  ## 0.6.2 (released 2015-04-30)
5
11
 
6
12
  * fix bug where WinRM file sync fails occasionally (retry 3 times) ([#43](https://github.com/tknerr/vagrant-managed-servers/issues/43), thanks @chrisbaldauf!)
data/Gemfile CHANGED
@@ -6,11 +6,12 @@ group :development do
6
6
  # We depend on Vagrant for development, but we don't add it as a
7
7
  # gem dependency because we expect to be installed within the
8
8
  # Vagrant environment itself using `vagrant plugin`.
9
- gem "vagrant", git: "https://github.com/mitchellh/vagrant.git"
9
+ gem "vagrant", git: "https://github.com/mitchellh/vagrant.git", ref: "v1.7.2"
10
10
  end
11
11
 
12
12
  group :plugins do
13
13
  gem "vagrant-managed-servers", path: "."
14
14
  gem "vagrant-omnibus", "1.4.1"
15
- gem "vagrant-berkshelf", "3.0.1"
16
- end
15
+ gem "vagrant-berkshelf", "4.0.4"
16
+ gem "vagrant-winrm-syncedfolders"
17
+ end
data/README.md CHANGED
@@ -19,7 +19,7 @@ Credits: this provider was initially based on the [vagrant-aws](https://github.c
19
19
  * SSH into managed servers.
20
20
  * Provision managed servers with any built-in Vagrant provisioner.
21
21
  * Reboot a managed server.
22
- * Minimal synced folder support via `rsync`.
22
+ * Synced folder support.
23
23
 
24
24
  ## Usage
25
25
 
@@ -133,10 +133,9 @@ specified, Vagrant will emit a warning and just ignore it.
133
133
 
134
134
  ## Synced Folders
135
135
 
136
- There is minimal support for synced folders. Upon `vagrant provision`,
137
- the managed servers provider will use
138
- `rsync` (if available) to uni-directionally sync the folder to
139
- the remote machine over SSH.
136
+ There is minimal synced folders support for provisioning linux guests
137
+ via rsync, and for windows guests via either smb, winrm or rsync
138
+ ([see below](https://github.com/tknerr/vagrant-managed-servers#synced-folders-windows)).
140
139
 
141
140
  This is good enough for all built-in Vagrant provisioners (shell,
142
141
  chef, and puppet) to work!
@@ -163,12 +162,18 @@ config.vm.define 'my-windows-server' do |windows|
163
162
  end
164
163
  end
165
164
  ```
166
- Synchronization of files using WinRM is known to be slow, so it is recommended
167
- that you disable synched folders that aren't critical. For instance, to disable the
168
- default /vagrant share, you could use the following code:
165
+
166
+ ### Synced Folders (Windows)
167
+ Vagrant Managed Servers will try several different mechanisms to sync folders for Windows guests. In order of priority:
168
+
169
+ 1. [SMB](http://docs.vagrantup.com/v2/synced-folders/smb.html) - requires running from a Windows host, an Administrative console, and Powershell 3 or greater. Note that there is a known [bug](https://github.com/mitchellh/vagrant/issues/3139) which causes the Powershell version check to hang for Powershell 2
170
+ 2. [WinRM](https://github.com/cimpress-mcp/vagrant-winrm-syncedfolders) - uses the WinRM communicator and is reliable, but can be slow for large numbers of files.
171
+ 3. [RSync](http://docs.vagrantup.com/v2/synced-folders/rsync.html) - requires `rsync.exe` installed and on your path.
172
+
173
+ Vagrant will try to use the best folder synchronization mechanism given your host and guest capabilities, but you can force a different type of folder sync with the `type` parameter of the `synced_folder` property in your Vagrantfile.
169
174
 
170
175
  ```ruby
171
- windows.vm.synced_folder '.', '/vagrant', disabled: true
176
+ windows.vm.synced_folder '.', '/vagrant', type: "winrm"
172
177
  ```
173
178
 
174
179
  ## Development
@@ -190,20 +195,20 @@ If those pass, you're ready to start developing the plugin. You can test
190
195
  the plugin without installing it into your Vagrant environment by using the
191
196
  `Vagrantfile` in the top level of this directory and use bundler to execute Vagrant.
192
197
 
193
- First, fake a managed server by bringing up the `fake_managed_server` vagrant VM with the default virtualbox provider:
198
+ First, let's pretend we have a managed server by bringing up the `local_linux` vagrant VM with the default virtualbox provider:
194
199
 
195
200
  ```
196
- $ bundle exec vagrant up fake_managed_server
201
+ $ bundle exec vagrant up local_linux
197
202
  ```
198
203
 
199
- Now you can use the managed provider (defined in a separate VM named `my_server`) to ssh into or provision the (fake) managed server:
204
+ Now you can use the managed provider (defined in a separate VM named `managed_linux`) to ssh into or provision the actual managed server:
200
205
 
201
206
  ```
202
207
  $ # link vagrant with the server
203
- $ bundle exec vagrant up my_server --provider=managed
208
+ $ bundle exec vagrant up managed_linux --provider=managed
204
209
  $ # ssh / provision
205
- $ bundle exec vagrant ssh my_server
206
- $ bundle exec vagrant provision my_server
210
+ $ bundle exec vagrant ssh managed_linux
211
+ $ bundle exec vagrant provision managed_linux
207
212
  $ # unlink
208
- $ bundle exec vagrant destroy my_server
213
+ $ bundle exec vagrant destroy managed_linux
209
214
  ```
data/Rakefile CHANGED
@@ -13,12 +13,15 @@ task :default => "spec"
13
13
 
14
14
  desc "runs the acceptance \"test\" as described in README"
15
15
  task :acceptance do
16
- begin
17
- sh "vagrant up fake_managed_server"
18
- sh "vagrant up my_server --provider=managed"
19
- sh "vagrant provision my_server"
20
- sh "vagrant reload my_server"
21
- ensure
22
- sh "vagrant destroy -f"
16
+ ['linux', 'windows'].each do |os|
17
+ begin
18
+ sh "vagrant up local_#{os}"
19
+ sh "vagrant up managed_#{os} --provider=managed"
20
+ sh "vagrant provision managed_#{os}"
21
+ sh "vagrant reload managed_#{os}"
22
+ ensure
23
+ sh "vagrant destroy -f managed_#{os}"
24
+ sh "vagrant destroy -f local_#{os}"
25
+ end
23
26
  end
24
27
  end
data/Vagrantfile CHANGED
@@ -4,35 +4,66 @@
4
4
  Vagrant.configure("2") do |config|
5
5
 
6
6
  #
7
- # fake a managed server by bringing up a virtualbox vm
7
+ # fake a managed linux server by bringing up a virtualbox vm
8
8
  #
9
- config.vm.define :fake_managed_server do |fms_config|
10
- fms_config.vm.box = "chef/ubuntu-12.04-i386"
11
- fms_config.vm.network :private_network, ip: "192.168.40.35"
12
- fms_config.berkshelf.enabled = false
9
+ config.vm.define :local_linux do |ll_config|
10
+ ll_config.vm.box = "chef/ubuntu-12.04-i386"
11
+ ll_config.vm.network :private_network, ip: "192.168.40.35"
12
+ ll_config.berkshelf.enabled = false
13
+ ll_config.vm.synced_folder ".", "/vagrant", disabled: true
13
14
  end
14
15
 
15
16
  #
16
- # configure managed provider to connect to `fake_managed_server`
17
+ # configure managed provider to connect to `local_linux`
17
18
  #
18
- config.vm.define :my_server do |ms_config|
19
+ config.vm.define :managed_linux do |ml_config|
19
20
 
20
- ms_config.vm.box = "tknerr/managed-server-dummy"
21
+ ml_config.vm.box = "tknerr/managed-server-dummy"
21
22
 
22
- ms_config.omnibus.chef_version = "12.0.3"
23
- ms_config.berkshelf.enabled = true
24
-
25
- ms_config.vm.provider :managed do |managed_config, override|
23
+ ml_config.omnibus.chef_version = "12.0.3"
24
+ ml_config.berkshelf.enabled = true
25
+
26
+ ml_config.vm.provider :managed do |managed_config, override|
26
27
  managed_config.server = "192.168.40.35"
27
28
  override.ssh.username = "vagrant"
28
- override.ssh.private_key_path = ".vagrant/machines/fake_managed_server/virtualbox/private_key"
29
+ override.ssh.private_key_path = ".vagrant/machines/local_linux/virtualbox/private_key"
29
30
  end
30
31
 
31
- ms_config.vm.provision :chef_solo do |chef|
32
+ ml_config.vm.provision :chef_solo do |chef|
32
33
  chef.cookbooks_path = [ './cookbooks' ]
33
34
  chef.add_recipe "apt"
34
35
  chef.add_recipe "apache2"
35
36
  end
36
37
  end
37
38
 
39
+
40
+
41
+ #
42
+ # fake a managed windows server by bringing up a virtualbox vm
43
+ #
44
+ config.vm.define :local_windows do |lw_config|
45
+ lw_config.vm.box = "boxcutter/eval-win7x86-enterprise"
46
+ lw_config.vm.network :private_network, ip: "192.168.40.36"
47
+ lw_config.berkshelf.enabled = false
48
+ lw_config.vm.synced_folder ".", "/vagrant", disabled: true
49
+ end
50
+
51
+ #
52
+ # configure managed provider to connect to `local_windows`
53
+ #
54
+ config.vm.define :managed_windows do |mw_config|
55
+
56
+ mw_config.vm.box = "tknerr/managed-server-dummy"
57
+
58
+ mw_config.berkshelf.enabled = false
59
+
60
+ mw_config.vm.communicator = :winrm
61
+ mw_config.winrm.username = 'vagrant'
62
+ mw_config.winrm.password = 'vagrant'
63
+
64
+ mw_config.vm.provider :managed do |managed, override|
65
+ managed.server = '192.168.40.36'
66
+ end
67
+ end
68
+
38
69
  end
@@ -34,22 +34,6 @@ module VagrantPlugins
34
34
  hostpath = File.expand_path(data[:hostpath], env[:root_path])
35
35
  guestpath = data[:guestpath]
36
36
 
37
- # Windows doesn't support ssh or rsync natively. Use winrm instead
38
- if (env[:machine].config.vm.communicator == :winrm) then
39
- env[:ui].info(I18n.t('vagrant_managed_servers.winrm_upload',
40
- :hostpath => hostpath,
41
- :guestpath => guestpath))
42
- env[:machine].communicate.tap do |comm|
43
- # When syncing many files, we've see SEC_E_INVALID_TOKEN errors
44
- # that appear to be transient (try again and it goes away). Let's
45
- # retry a few times to add some robustness.
46
- retryable(tries: 3, sleep: 1) do
47
- comm.upload(hostpath, guestpath)
48
- end
49
- end
50
- next
51
- end
52
-
53
37
  unless Vagrant::Util::Which.which('rsync')
54
38
  env[:ui].warn(I18n.t('vagrant_managed_servers.rsync_not_found_warning'))
55
39
  break
@@ -26,21 +26,6 @@ module VagrantPlugins
26
26
 
27
27
  b2.use LinkServer
28
28
  end
29
- =begin
30
- b.use HandleBoxUrl
31
- b.use ConfigValidate
32
- b.use Call, IsReachable do |env, b2|
33
- if env[:result]
34
- b2.use !MessageNotReachable
35
- next
36
- end
37
-
38
- b2.use Provision
39
- b2.use SyncFolders
40
- b2.use WarnNetworks
41
- b2.use LinkServer
42
- end
43
- =end
44
29
  end
45
30
  end
46
31
 
@@ -77,7 +62,15 @@ module VagrantPlugins
77
62
  end
78
63
 
79
64
  b3.use Provision
80
- b3.use SyncFolders
65
+ if env[:machine].config.vm.communicator == :winrm
66
+ # Use the builtin vagrant folder sync for Windows target servers.
67
+ # This gives us SMB folder sharing, which is much faster than the
68
+ # WinRM uploader for any non-trivial number of files.
69
+ b3.use Vagrant::Action::Builtin::SyncedFolders
70
+ else
71
+ # Vagrant managed servers custom implementation
72
+ b3.use SyncFolders
73
+ end
81
74
  end
82
75
  end
83
76
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module ManagedServers
3
- VERSION = "0.6.2"
3
+ VERSION = "0.7.0"
4
4
  end
5
5
  end
@@ -15,6 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.required_rubygems_version = ">= 1.3.6"
16
16
  s.rubyforge_project = "vagrant-managed-servers"
17
17
 
18
+ s.add_runtime_dependency "vagrant-winrm-syncedfolders"
18
19
  s.add_development_dependency "rake"
19
20
  s.add_development_dependency "rspec-core", "~> 2.14.7"
20
21
  s.add_development_dependency "rspec-expectations", "~> 2.14.5"
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-managed-servers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Torben Knerr
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-30 00:00:00.000000000 Z
11
+ date: 2015-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: vagrant-winrm-syncedfolders
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rake
15
29
  requirement: !ruby/object:Gem::Requirement