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

LSB facts are a pain. #3

Closed
razorsedge opened this issue Sep 10, 2013 · 2 comments
Closed

LSB facts are a pain. #3

razorsedge opened this issue Sep 10, 2013 · 2 comments

Comments

@razorsedge
Copy link
Contributor

@jhoblitt

When installing @core on EL6 during kickstart, redhat-lsb is not installed resulting in the following on the first Puppet run:

Module ipmi is not supported on lsbmajdistrelease at /etc/puppetlabs/puppet/modules/forge/ipmi/manifests/params.pp:26

I try not to use LSB facts, and will throw the following in the params.pp and reference $::module::params::majdistrelease in the module code:

  if $::operatingsystemmajrelease { # facter 1.7+
    $majdistrelease = $::operatingsystemmajrelease
  } elsif $::lsbmajdistrelease {    # requires LSB to already be installed
    $majdistrelease = $::lsbmajdistrelease
  } elsif $::os_maj_version {       # requires stahnma/epel
    $majdistrelease = $::os_maj_version
  } else {
    $majdistrelease = regsubst($::operatingsystemrelease,'^(\d+)\.(\d+)','\1')
  }
@jhoblitt
Copy link
Owner

The facter RPM probably should pull in redhat-lsb as a dep.

I'm not enthusiastic about putting that logic into the module as it's working around what is really a fact problem. I'd rather do something line checking for the defined-ness of the used lsb fact and failing if it's not set, introducing a dep on a module that will install the redhat-lsb package, or using ensure_packages() from stdlib to make sure redhat-lsb is present.

@razorsedge
Copy link
Contributor Author

I firmly believe that facter should not require redhat-lsb. That's a whole load of software many people do not want on their servers (including CUPS).

The problem here is that I actually do include lsb in my manifests along with include ipmi, but catalog compilation fails. Perhaps you could use $::operatingsystemmajrelease instead of $::lsbmajdistrelease?

Or do you really need to fail on the default of case $::lsbmajdistrelease { }?

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

No branches or pull requests

2 participants