sous-chefs / filesystem

Development repository for the filesystem cookbook
https://supermarket.chef.io/cookbooks/filesystem
Apache License 2.0
24 stars 7 forks source link

LocalJumpError for nfs device #34

Closed jaredstehler closed 4 years ago

jaredstehler commented 7 years ago

Cookbook version

0.11.1

Chef-client version

12.7.2

Platform Details

AWS EC2 Ubuntu 14.04

Scenario:

Trying to mount an nfs4 (AWS EFS) device

Steps to Reproduce:

Chef config:

  "filesystems": {
    "shared_fs": {
      "device": "fs-nnnnnnnn.efs.us-east-1.amazonaws.com:/", 
      "fstype": "nfs4", 
      "mount": "/mnt/shared", 
      "options": "nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2"
    }
}```

### Expected Result:
EFS mounted at `/mnt/shared` on ec2 host

### Actual Result:
Hangs waiting for device, as `nfs4` isnt one of `net_fs_types = %w(nfs nfs4 cifs smp nbd)`; when I changed the device type to `nfs`, I get the following error:

LocalJumpError: filesystem_create_all_from_key[filesystems] (filesystem::default line 24) had an error: LocalJumpError: filesystem[shared_fs] (/opt/bootstrap/vendor/filesystem/providers/create_all_from_key.rb line 33) had an error: LocalJumpError: ruby_block[wait for device] (/opt/bootstrap/vendor/filesystem/providers/default.rb line 88) had an error: LocalJumpError: unexpected return /opt/bootstrap/vendor/filesystem/providers/default.rb:94:in block (3 levels) in class_from_file' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/provider/ruby_block.rb:35:incall' /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/chef-12.7.2/lib/chef/provider/ruby_block.rb:35:in `block in action_run'

MarkGibbons commented 4 years ago

Looks like we need to add support for nfs4 fs types and add tests.

MarkGibbons commented 4 years ago

The cookbook will support mounting NFS filesystems by creating a mount point directory, updating /etc/fstab and issuing the mount command after #90 is merged. I think that will take care of the conditions you brought up.