example42 / puppet-yum

Puppet module for Yum
Other
43 stars 116 forks source link

operatingsystemrelease fact regexp #178

Closed krasnican closed 7 years ago

krasnican commented 7 years ago

Hi,

operatingsystemrelease regexp fails with el7 (using yum-cron feature). e.g. operatingsystemrelease 7.3.1611 is matched as el6 because of regexp (params.pp:46) - version contains "6":

  $update_template = $::operatingsystemrelease ? {
    /6.*/ => 'yum/yum-cron.erb',
    /7.*/ => 'yum/yum-cron-rhel7.erb',
    default => undef,
  }

Please use operatingsystemmajrelease fact instead, or change regexp to beggins with 6/7 - /^6./ /^7./

This works fine:

  $update_template = $::operatingsystemrelease ? {
    /^6.*/ => 'yum/yum-cron.erb',
    /^7.*/ => 'yum/yum-cron-rhel7.erb',
    default => undef,
  }

  $update_configuration_file = $::operatingsystemrelease ? {
    /^6.*/ => '/etc/sysconfig/yum-cron',
    /^7.*/ => '/etc/yum/yum-cron.conf',
    default => undef,
  }

Thanks, Tomas

alvagante commented 7 years ago

Please send PR