voxpupuli / puppet-nfs

Installs and configures NFS server and clients
https://forge.puppet.com/modules/derdanne/nfs
Apache License 2.0
16 stars 81 forks source link

Add Puppet 8 compatibility #178

Closed tuxmea closed 4 months ago

tuxmea commented 8 months ago
td-adc commented 7 months ago

@derdanne Any chance you could take a look at this?

bschonec commented 5 months ago

@derdanne I have several updates awaiting this pull request. Would you be so kind as to merge it?

bschonec commented 5 months ago

@tuxmea , I'm getting the following errors when running 'bundle install'. Would you test against your puppet8 branch to see if you're getting the same error before I put too much effort into figuring out why?

Could not find compatible versions

Because voxpupuli-test < 2.5.0 depends on puppetlabs_spec_helper >= 2.14.0
  and voxpupuli-test >= 2.5.0, < 4.0.0 depends on puppetlabs_spec_helper >= 2.16.0,
  voxpupuli-test < 4.0.0 requires puppetlabs_spec_helper >= 2.14.0.
And because voxpupuli-test >= 5.5.0, < 6.0.0 depends on puppetlabs_spec_helper >= 5.0.3
  and voxpupuli-test >= 4.0.0, < 5.5.0 depends on puppetlabs_spec_helper >= 4.0.0,
  voxpupuli-test < 6.0.0 requires puppetlabs_spec_helper >= 2.14.0.
Because rspec-puppet >= 2.0, < 3.A could not be found in https://github.com/puppetlabs/rspec-puppet.git (at main@6fd7094)
  and puppetlabs_spec_helper >= 1.2.1, < 6.0.0.rc.1 depends on rspec-puppet ~> 2.0,
  puppetlabs_spec_helper >= 1.2.1, < 6.0.0.rc.1 cannot be used.
Thus, voxpupuli-test < 6.0.0 requires puppetlabs_spec_helper >= 6.0.0.rc.1.
And because voxpupuli-test >= 7.1.0 depends on puppetlabs_spec_helper >= 7.0.1, < 8.A
  and puppetlabs_spec_helper >= 7.1.0, < 7.2.0 depends on puppet-syntax ~> 4.1,
  either puppet-syntax ~> 4.1 or puppetlabs_spec_helper >= 6.0.0.rc.1, < 7.1.0 OR >= 7.2.0.
And because puppetlabs_spec_helper >= 7.0.4, < 7.1.0 depends on puppet-syntax ~> 4.0
  and puppetlabs_spec_helper >= 5.0.0, < 7.0.4 depends on puppet-syntax ~> 3.0,
  either puppet-syntax ~> 3.0 OR >= 4.0, < 5.A or puppetlabs_spec_helper >= 7.2.0.
And because puppet-syntax >= 2.6.1, < 4.0.0 depends on puppet >= 5
  and puppetlabs_spec_helper >= 7.2.0 depends on puppet-syntax >= 4.1.1, < 5.A,
  either puppet >= 5 or puppet-syntax >= 4.0.0, < 5.A.
So, because puppet-syntax >= 4.0.0 depends on puppet >= 7, < 9
  and Gemfile depends on puppet ~> 4.0,
  version solving has failed.
bschonec commented 5 months ago

@tuxmea I can confirm that your latest updates fix my "bundle install" problem.

bschonec commented 5 months ago

Now that this project is under the Voxpupuli project, can we get this merged in so that the tests are fixed? I have things I'd like to contribute, too.

yakatz commented 5 months ago

I approved the tests to run

yakatz commented 5 months ago

The test setup needs to be updated to use the newer Ruby and Puppet versions: .github/workflows/test-suite.yaml

tuxmea commented 5 months ago

Tests are still failing. I am unsure, why. Can we get this merged, so we have Puppet 8 support? rspec tests show no errors.

TheMeier commented 5 months ago

Hm I think we should not simply ignore that:

  Error: /Stage[main]/Nfs::Server::Service/Service[nfs-kernel-server]/ensure: change from 'stopped' to 'running' failed: Systemd start for nfs-kernel-server failed!
tuxmea commented 5 months ago

I am not able to reproduce the Ubuntu 20 error on a vagrant box. Code:

# Vagrantfile
Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/focal64"
end
# install puppet
wget https://apt.puppet.com/puppet8-release-focal.deb
sudo dpkg -i puppet8-release-focal.deb
sudo apt-get update
apt install -y puppet-agent

/opt/puppetlabs/puppet/bin/puppet module install puppetlabs-stdlib
/opt/puppetlabs/puppet/bin/puppet module install puppetlabs/concat
/opt/puppetlabs/puppet/bin/puppet module install puppetlabs/transition
/opt/puppetlabs/puppet/bin/puppet module install puppet/augeasproviders_core
/opt/puppetlabs/puppet/bin/puppet module install puppet/augeasproviders_shellvar
/opt/puppetlabs/puppet/bin/puppet module install puppetlabs/augeas_core
/opt/puppetlabs/puppet/bin/puppet module install puppetlabs/mount_core

ln -s /vagrant /etc/puppetlabs/code/environments/production/modules/nfs
# nfs.pp
        file { ['/export', '/data_folder', '/homeexport']:
          ensure => 'directory',
        }
        class { '::nfs':
          server_enabled => true,
          nfs_v4 => true,
          nfs_v4_idmap_domain => 'example.org',
          nfs_v4_export_root  => '/export',
          nfs_v4_export_root_clients => '*(rw,fsid=0,insecure,no_subtree_check,async,no_root_squash)',
        }
        nfs::server::export { '/data_folder':
          ensure  => 'mounted',
          clients => '*(rw,insecure,async,no_root_squash,no_subtree_check)',
          before => Class['nfs::server::service'],
        }
        nfs::server::export { '/homeexport':
          ensure  => 'mounted',
          clients => '*(rw,insecure,async,root_squash,no_subtree_check)',
          mount   => '/srv/home',
          before => Class['nfs::server::service'],
        }
h-haaks commented 5 months ago

In a Debian 10 container:


root@debian10-64-1:/# systemctl status nfs-server
● nfs-server.service - NFS server and services
   Loaded: loaded (/lib/systemd/system/nfs-server.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2024-06-07 13:03:26 UTC; 1min 8s ago
  Process: 2691 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=1/FAILURE)
  Process: 2692 ExecStopPost=/usr/sbin/exportfs -au (code=exited, status=0/SUCCESS)
  Process: 2693 ExecStopPost=/usr/sbin/exportfs -f (code=exited, status=0/SUCCESS)

Jun 07 13:03:26 debian10-64-1 systemd[1]: Starting NFS server and services...
Jun 07 13:03:26 debian10-64-1 exportfs[2691]: exportfs: /export does not support NFS export
Jun 07 13:03:26 debian10-64-1 systemd[1]: nfs-server.service: Control process exited, code=exited, status=1/FAILURE
Jun 07 13:03:26 debian10-64-1 systemd[1]: nfs-server.service: Failed with result 'exit-code'.
Jun 07 13:03:26 debian10-64-1 systemd[1]: Stopped NFS server and services.
root@debian10-64-1:/# 
h-haaks commented 5 months ago

from https://hub.docker.com/r/kvaps/nfs-server

Requirements

The Docker host kernel will need the following kernel modules
    nfs
    nfsd
    rpcsec_gss_krb5 (only if Kerberos is used)

Usually you can enable these modules with: modprobe {nfs,nfsd,rpcsec_gss_krb5}

The container will need to run with CAP_SYS_ADMIN (or --privileged). This is necessary as the server needs to mount several filesystems inside the container to support its operation, and performing mounts from inside a container is impossible without these capabilities.

I guess this is a bit hard to satisfy on the github runners?

h-haaks commented 4 months ago

Some additional testing from me using beaker-docker on a rocky8 host.

rocky8 and 9 OK debian12 OK debian10 and 11 Fail ubuntu2204 OK ubuntu2004 Fail

h-haaks commented 4 months ago

To me there is just to many unrelated changes in this PR I think it would be a good thing to focus on the transition into vox pupuli (as separate PRs) before adding new enhancements.