puppetlabs / pdk

The shortest path to better modules: Puppet Development Kit; Download:
https://puppet.com/download-puppet-development-kit
Apache License 2.0
225 stars 105 forks source link

Customer Issue: RHEL7 #1167

Closed da-ar closed 1 year ago

da-ar commented 3 years ago

“I’ve discovered issue with pdk that prevents unit tests to be written where the operating system facts from the bundled facterdb gem are required. The operatingsystemrelease and os.release.full facts do not appear to have full coverage for RHEL releases to date (https://access.redhat.com/articles/3078) and the version number for RHEL7 seems incorrect. i.e. at a minimum I would expect to see: 7.5 7.6 7.7 7.8 8 8.1 8.2 8.3 This is the case for both our current version 2.1.1 and the latest release 2.2.0”

pdk --version
2.1.1

$ pdk bundle info facterdb
pdk (INFO): Using Ruby 2.5.9
pdk (INFO): Using Puppet 6.22.1
 * facterdb (1.6.0)
       Summary: A Database of OS facts provided by Facter
       Homepage: http://github.com/camptocamp/facterdb
       Path: /opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/facterdb-1.6.0

awk '/operatingsystemrelease/' /opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/facterdb-1.6.0/facts/*/redhat-[78]-x86_64.facts | sort -u
 "operatingsystemrelease": "7.2.1511",
 "operatingsystemrelease": "7.6.1810",
 "operatingsystemrelease": "8.0",

pdk --version
2.2.0

# pdk bundle info facterdb
pdk (INFO): Using Ruby 2.7.3
pdk (INFO): Using Puppet 7.9.0
 * facterdb (1.7.0)
       Summary: A Database of OS facts provided by Facter
       Homepage: http://github.com/voxpupuli/facterdb
       Path: /opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/facterdb-1.7.0

awk '/operatingsystemrelease/' /opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/facterdb-1.7.0/facts/*/redhat-[78]-x86_64.facts | sort -u
 "operatingsystemrelease": "7.2.1511",
 "operatingsystemrelease": "7.6.1810",
 "operatingsystemrelease": "8.0", (edited) pdk --version
2.1.1

$ pdk bundle info facterdb
pdk (INFO): Using Ruby 2.5.9
pdk (INFO): Using Puppet 6.22.1
 * facterdb (1.6.0)
       Summary: A Database of OS facts provided by Facter
       Homepage: http://github.com/camptocamp/facterdb
       Path: /opt/puppetlabs/pdk/share/cache/ruby/2.5.0/gems/facterdb-1.6.0

awk '/operatingsystemrelease/' /opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/facterdb-1.6.0/facts/*/redhat-[78]-x86_64.facts | sort -u
 "operatingsystemrelease": "7.2.1511",
 "operatingsystemrelease": "7.6.1810",
 "operatingsystemrelease": "8.0",

pdk --version
2.2.0

# pdk bundle info facterdb
pdk (INFO): Using Ruby 2.7.3
pdk (INFO): Using Puppet 7.9.0
 * facterdb (1.7.0)
       Summary: A Database of OS facts provided by Facter
       Homepage: http://github.com/voxpupuli/facterdb
       Path: /opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/facterdb-1.7.0

awk '/operatingsystemrelease/' /opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/facterdb-1.7.0/facts/*/redhat-[78]-x86_64.facts | sort -u
 "operatingsystemrelease": "7.2.1511",
 "operatingsystemrelease": "7.6.1810",
 "operatingsystemrelease": "8.0", (edited) 

Most likely related: https://github.com/voxpupuli/facterdb/issues/150

bastelfreak commented 2 years ago

Hey, At Vox Pupuli we do not have access to RHEL machines. Can you provide updated factsets for facterdb? Also both facterdb versions you have are quite outdated. I don't know how pdk pins the versions, but as a facterdb maintainer I highly recommend using semantic verisoning an allowing >= 1.15.0 < 2.0.0.

We also have a rake task to generate RHEL-like factsets, that should be adjusted for RHEL it looks like: https://github.com/voxpupuli/facterdb/blob/master/rakelib/rhel_alts.rake

github-actions[bot] commented 2 years ago

This issue has been marked stale because it is open with no recent activity. The PDK Team is actively prioritizing existing bugs and new features, if this issue is still important to you please comment and we will add this to our backlog to complete.

david22swan commented 1 year ago

Closing this as from what I can tell it has been resolved.