Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option vagrant_prefer_nfs #904

Closed
wants to merge 1 commit into from
Closed

Conversation

tangrufus
Copy link
Member

On Macs that using APFS, vagrant up gives:

==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -o vers=3,udp 192.168.50.1:/Users/XXX/Code/site /vagrant-nfs-example.com
Stdout from the command:
Stderr from the command:
mount.nfs: access denied by server while mounting 192.168.50.1:/Users/XXX/Code/site

See:

This pull request adds vagrant_prefer_nfs option so that non-windows users could have a choice to use default synced_folder type.

Only tested with vagrant 1.9.8 + macOS 10.13 + APFS.

For APFS user:

  1. Set vagrant_prefer_nfs: false
  2. FORCE_ANSIBLE_LOCAL=true vagrant up

Note: This won't work on vagrant 2.0, see: https://discourse.roots.io/t/the-requested-ansible-version-2-4-0-was-not-found-on-the-guest/10513

Discuss:

@swalkinshaw
Copy link
Member

re: #439, we did enable ansible-local by default 😄

I'm fine with adding this option regardless. Is there no better solution for APFS yet?

@tangrufus
Copy link
Member Author

we did enable ansible-local by default

Is that true for non-wondows users?
https://github.com/roots/trellis/blob/master/lib/trellis/vagrant.rb#L40-L42

Is there no better solution for APFS yet?

I don't find one.

Please test this pull request on non-APFS Macs and other platforms.

@swalkinshaw
Copy link
Member

Is that true for non-windows users?

Yep 👍

@tangrufus
Copy link
Member Author

# https://github.com/roots/trellis/blob/master/lib/trellis/vagrant.rb#L40-L42

def local_provisioning?
  @local_provisioning ||= Vagrant::Util::Platform.windows? || !which('ansible-playbook') || ENV['FORCE_ANSIBLE_LOCAL']
end

To use Trellis for remote servers, we recommend installing Ansible locally on your host machine
https://roots.io/trellis/docs/remote-server-setup/

If Ansible is installed as the doc suggests, ansiable_local is not used.

@swalkinshaw
Copy link
Member

Yeah, sorry I just meant it's the default for everyone. If someone follows our docs as of now, they'd get ansible local.

@swalkinshaw
Copy link
Member

Is this PR useful as is?

Or does it depend on:

Should we implicitly set ansible_local when vagrant_prefer_nfs: false(like what we are doing for windows users)?

@tangrufus
Copy link
Member Author

After moving to a SSD harddisk, trellis works out of the box. I think this pull request should not be merged and APFS on traditional harddisk users should manually disable NFS and use ansible_local.

@tangrufus tangrufus closed this Dec 20, 2017
@tangrufus tangrufus deleted the skip-nfs branch March 2, 2018 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants