ggiamarchi / vagrant-openstack-provider

Use Vagrant to manage OpenStack Cloud instances.
MIT License
247 stars 101 forks source link

Rsync of folders doesn't work when image doesn't have Rsync, also it can't be disabled #269

Closed theratboss closed 7 years ago

theratboss commented 8 years ago

The error is: ==> site: Rsyncing folder: /xxx/ => /vagrant There was an error when attemping to rsync a share folder. Please inspect the error message below for more info.

Host path: xxxx
Guest path: /vagrant
Error: Warning: Permanently added '10.10.2.16' (ECDSA) to the list of known hosts.
bash: rsync: command not found
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: remote command not found (code 127) at io.c(226) [sender=3.1.1]

According to documentation of vagrant adding the line below should disable the default sync folder, but it doesn't take it into account. vconfig.vm.synced_folder ".", "/vagrant", disabled: true

Also they should have a way of installing rsync automatically, but that also doesn't work with the provider

openstack provider code, inside I've added a comment in front of SyncFolders to work around it:

  # This action is called when `vagrant provision` is called.
  def self.action_provision
    new_builder.tap do |b|
      b.use ConfigValidate
      b.use ConnectOpenstack
      b.use Call, ReadState do |env, b2|
        if env[:machine_state_id] == :not_created
          b2.use Message, I18n.t('vagrant_openstack.not_created')
        else
          b2.use ProvisionWrapper
          #b2.use SyncFolders
        end
      end
    end
  end

Example for the virtualbox provider build in vagrant we have the SyncFolders in action start and it calls the cleanup method before that. Could that be a hint how to fix it?

def self.action_start ... b2.use SyncedFolderCleanup .... b2.use Call, IsState, :not_created do |env2, b3| if env2[:result] .... b3.use SyncedFolders

jhoblitt commented 8 years ago

This directive works for me with 0.7.0+ to disable syncing:

  config.vm.provider :openstack do |os,override|
    os.sync_method        = 'none'
    ...
  end
glitchcrab commented 8 years ago

Can we get some input on this? I'm provisioning to my provider's Openstack cloud using a stock Debian Jessie cloud image and currently I'm unable to use this workflow as the image doesn't have Rsync installed (which I need as I'm provisioning as part of a repeatable package building environment). Vagrant offers the ability for a provider to install rsync if the guest OS doesn't already have it - would it be possible to work this in? I've had a scan of the code and I can't see it doing this anywhere - I would attempt it myself but ruby is not my forte.

Paging @ggiamarchi

ggiamarchi commented 7 years ago

The provider has moved to the standard vagrant synced folders middleware. I close all issues related to the legacy synced folders implementation. Feel free to comment/reopen this thread if you think you still get an issue related to this provider.