You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changes in #357 break Ubuntu version dependent resources when using Facter 3.x.
The changes integrate the new facts hash from Puppet 4, but it appears that the version strings were also changed to 12, 14, etc., which is broken for current releases of Puppet 4 and Facter 3.x. Facter reports these facts as 12.04, 14.04, or 14.10, etc. The old Facter 2.x was reporting 12 and 14, but it appears that it can be very buggy from release to release.
Either way, using $foo == '14.04', or $foo == '14' are both short sighted and will fail for anything but those exact versions. What should be done, and in general a Puppet best practice, is to use the built-in versioncmp function to do a version comparison to ensure that your resources are applied to any applicable versions.
Examples:
# Ubuntu 14 onlyif (versioncmp($facts['os']['release']['full'], '14') >= 0 and
versioncmp($facts['os']['release']['full'], '16') < 0) {
# do something version specific
}
# Ubuntu 16 and later releases:if versioncmp($facts['os']['release']['full'], '16') >= 0 {
# do something version specific
}
The text was updated successfully, but these errors were encountered:
Well, I looked over #357 and saw a couple of == changes for the Ubuntu version and made an assumption about all of the changes. My apologies. This doesn't affect ALL ubuntu versions, just 12 and 14. I'm going to submit a PR with a fix in it for the affected manifests.
Changes in #357 break Ubuntu version dependent resources when using Facter 3.x.
The changes integrate the new facts hash from Puppet 4, but it appears that the version strings were also changed to
12
,14
, etc., which is broken for current releases of Puppet 4 and Facter 3.x. Facter reports these facts as12.04
,14.04
, or14.10
, etc. The old Facter 2.x was reporting12
and14
, but it appears that it can be very buggy from release to release.This behavior can be verified by installing Puppet 4 from the official Puppetlabs Ubuntu repository.
Either way, using
$foo == '14.04'
, or$foo == '14'
are both short sighted and will fail for anything but those exact versions. What should be done, and in general a Puppet best practice, is to use the built-in versioncmp function to do a version comparison to ensure that your resources are applied to any applicable versions.Examples:
The text was updated successfully, but these errors were encountered: