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 Puppet 8 compatibility #178

Merged
merged 32 commits into from
Jun 10, 2024
Merged

Add Puppet 8 compatibility #178

merged 32 commits into from
Jun 10, 2024

Conversation

tuxmea
Copy link
Member

@tuxmea tuxmea commented Feb 16, 2024

  • update gems to use voxpupuli test gem
  • lint auto fix
  • update puppet version im metadata.json

- update gems to use voxpupuli test gem
- lint auto fix
- update puppet version im metadata.json
@td-adc
Copy link

td-adc commented Mar 27, 2024

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

@bschonec
Copy link
Contributor

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

@bschonec
Copy link
Contributor

@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
Copy link
Contributor

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

@bschonec
Copy link
Contributor

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
Copy link

yakatz commented May 31, 2024

I approved the tests to run

@yakatz
Copy link

yakatz commented May 31, 2024

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

@tuxmea
Copy link
Member Author

tuxmea commented Jun 7, 2024

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
Copy link

TheMeier commented Jun 7, 2024

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
Copy link
Member Author

tuxmea commented Jun 7, 2024

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
Copy link

h-haaks commented Jun 7, 2024

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
Copy link

h-haaks commented Jun 7, 2024

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
Copy link

h-haaks commented Jun 7, 2024

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

tuxmea added 3 commits June 8, 2024 15:10
containers can not start the servcie due to missing kernel modules
.rspec Outdated
@@ -0,0 +1,5 @@
# Managed by modulesync - DO NOT EDIT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please delete the file, modulesync doesn't deploy them anymore.

.rspec_parallel Outdated
@@ -0,0 +1,4 @@
# Managed by modulesync - DO NOT EDIT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please delete the file, modulesync doesn't deploy them anymore.

@@ -1,11 +1,20 @@
# nfs

[![Build Status](https://github.com/voxpupuli/puppet-nfs/workflows/CI/badge.svg)](https://github.com/voxpupuli/puppet-nfs/actions?query=workflow%3ACI)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you pull the README.md cleanup into it's own PR? It's not really related to the puppet 8 implementation

if $::nfs::defaults_file != undef {
if $::nfs::client_gssd_options != '' {
$_gssd1_aug = ["set ${::nfs::client_gssdopt_name} \"'${::nfs::client_gssd_options}'\""]
if $nfs::client::nfs_v4 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also a bit torn with all those linting changes, they are really not related to implementing Puppet 8 support, but rather pleasing puppet-lint. Can you maybe provide one PR with the result of bundle exec rake lint_fix?

@h-haaks
Copy link

h-haaks commented Jun 9, 2024

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.

@bastelfreak bastelfreak changed the title Puppet 8 compatibility Add Puppet 8 compatibility Jun 10, 2024
@tuxmea tuxmea merged commit 8409ddf into voxpupuli:master Jun 10, 2024
12 checks passed
@tuxmea tuxmea deleted the puppet8 branch June 10, 2024 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants