Closed tknerr closed 8 years ago
proof that the workaround works:
C:\Repos\_github\vagrant-managed-servers>vagrant plugin install vagrant-winrm-syncedfolders
Installing the 'vagrant-winrm-syncedfolders' plugin. This can take a few minutes...
Installed the plugin 'vagrant-winrm-syncedfolders (0.1.0)'!
C:\Repos\_github\vagrant-managed-servers>vagrant plugin list
vagrant-berkshelf (4.0.4)
- Version Constraint: 4.0.4
vagrant-cachier (1.2.0)
- Version Constraint: 1.2.0
vagrant-winrm-syncedfolders (0.1.0)
vagrant-managed-servers (0.7.0)
vagrant-omnibus (1.4.1)
- Version Constraint: 1.4.1
vagrant-proxyconf (1.5.0)
- Version Constraint: 1.5.0
vagrant-share (1.1.3, system)
vagrant-toplevel-cookbooks (0.2.4)
- Version Constraint: 0.2.4
vagrant-winrm (0.7.0)
- Version Constraint: 0.7.0
C:\Repos\_github\vagrant-managed-servers>vagrant provision managed_windows
==> managed_windows: The machine is backed by a cloud provider (managed), caching
==> managed_windows: will be disabled.
==> managed_windows: Warning! The ManagedServers provider doesn't support any of the Vagrant
==> managed_windows: high-level network configurations (`config.vm.network`). They will be ignored.
==> managed_windows: Uploading with WinRM: C:/Repos/_github/vagrant-managed-servers => /vagrant
@chrisbaldauf ideas?
Hmm, that's disappointing. Perhaps it could be addressed with documentation and remove the gem spec dependency? In vagrant-orchestrate, I use the required_plugins pattern where I lost all the plugins that I need to install for a project:
https://github.com/Cimpress-MCP/vagrant-orchestrate#plugins
The biggest downside that I can see to the documentation approach is that it could (most likely will) break anyone using this for Windows with a pre 0.7 version and require them to install a new plugin to get back to working.
I'll keep looking around.
Or perhaps a new action that tests whether the host is Windows and the winrm syncedfolders plugin is installed with Vagrant.has_plugin? And prints a warning with a message including how to install. This feels like better reinforcement and is a cleaner but not totally clean upgrade path for those using Windows.
I found an example where a run fails until the plugin is installed: https://github.com/tkambler/perfect-vagrant/blob/08be599c0fb02d0401ef5bcac86ed3c7e41babe3/lib/required_plugins.rb
A third option would be to fork the code and include it in VMS as we had it earlier in the pull request. Easiest for the user, since it just works but ugliest from a code maintenance standpoint. It isn't very much code though and we might be able to use something like git subtree.
Taking the warning approach, I've got something that I think will be reasonable. Running locally with vagrant-winrm-syncedfolders
not present in my Gemfile plugins section:
d:\dev\vagrant-managed-servers>bundle exec vagrant provision managed_windows
Your Gemfile lists the gem vagrant-managed-servers (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of
just one of them later.
Vagrant appears to be running in a Bundler environment. Your
existing Gemfile will be used. Vagrant will not auto-load any plugins
installed with `vagrant plugin`. Vagrant will autoload any plugins in
the 'plugins' group in your Gemfile. You can force Vagrant to take over
with VAGRANT_FORCE_BUNDLER.
You appear to be running Vagrant outside of the official installers.
Note that the installers are what ensure that Vagrant has all required
dependencies, and Vagrant assumes that these dependencies exist. By
running outside of the installer environment, Vagrant may not function
properly. To remove this warning, install Vagrant using one of the
official packages from vagrantup.com.
==> managed_windows: Warning! The ManagedServers provider doesn't support any of
the Vagrant
==> managed_windows: high-level network configurations (`config.vm.network`). Th
ey will be ignored.
==> managed_windows: Warning! The vagrant-winrm-syncedfolders plugin was not found and
==> managed_windows: is recommended for Windows guests. Install it with
==> managed_windows: `vagrant plugin install vagrant-winrm-syncedfolders`.
==> managed_windows: Preparing SMB shared folders...
managed_windows: You will be asked for the username and password to use for
the SMB
managed_windows: folders shortly. Please use the proper username/password of
your
managed_windows: Windows account.
managed_windows:
managed_windows: Username:
Thanks! I'll double check on the mailing list for handling inter plugin dependencies, but all in all I like the documentation approach.
The warning in this case is useful too, but might be annoying if you want to use SMB. Would be ideal, if we could display it only when SMB didn't work, but guess that's not easily doable.
I'm fine with documentation only too, since we are not at 1.0 yet I don't mind too much about this backwards incompatibility with pre-0.7.0 winrm users, since there is an easy workaround.
I wonder if it is as simple as referencing the dependent plugin from within
the vagrant-managed-servers.rb. It was successfully loaded when the code
was packaged with vms, so maybe we're just missing a require statement. Can
you try to require "vagrant-winrm-syncedfolders"
after line 3
On Fri, May 22, 2015 at 11:47 AM, Torben Knerr notifications@github.com wrote:
Thanks! I'll double check on the mailing list for handling inter plugin dependencies, but all in all I like the documentation approach.
The warning in this case is useful too, but might be annoying if you want to use SMB. Would be ideal, if we could display it only when SMB didn't work, but guess that's not easily doable.
I'm fine with documentation only too, since we are not at 1.0 yet I don't mind too much about this backwards incompatibility with pre-0.7.0 winrm users, since there is an easy workaround.
— Reply to this email directly or view it on GitHub https://github.com/tknerr/vagrant-managed-servers/issues/49#issuecomment-104695585 .
I tried adding the require and it appears to have worked for me. PR coming and then we can try it packaged. Perhaps a pre-release gem version is in order so you don't wind up churning through a number of minor versions if this doesn't work?
Thanks @chrisbaldauf! I built and installed the plugin locally and it seems to work. Will push a 0.7.1 release shortly
fixed via #51 and released as 0.7.1
Thanks @tknerr!
Looks like installing
vagrant plugin install vagrant-managed-servers
install the vagrant-winrm-syncedfolders plugin as a gem dependency only:This way it's not registered with vagrant and thus the "winrm" synced folder mechanism is not detected.
The workaround is to
vagrant plugin install vagrant-winrm-syncedfolders
manually.