Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Check fact (version) after package upgrade

$
0
0
We have syslog-ng running on our systems. Most have 3.x, but many have 2.x and the configuration files are not compatible. We don't want to stay on 2.x (features like @include are missing). If for some reason the Package[] resource is unable to ensure syslog-ng is at least 3.x, I need Puppet to bail out. I think. I'm open to suggestions of how to do this better. Otherwise overwriting the config at that point will break a system running syslog-ng 2.x. We're trying to deploy Puppet to existing systems, so leaving them be until we can figure it out rather than breaking the system is preferred. The class I have looks like this: class syslog_ng::package { package { 'syslog-ng': ensure => latest, } $minimum_version = '3.0.0' unless versioncmp($::syslog_ng_version, $minimum_version) >= 0 { fail("syslog_ng version (${::syslog_ng_version}) requirement not met. Must be at least this tall to ride: ${minimum_version}") } } Is it possible to have the `unless ... fail` happen after the package[]? Otherwise, it bails early - the installed version is too old. The second half of the question is that I think the custom fact `syslog_ng_version` is computed at the start of the agent run. Obviously, if the package were upgraded, we can't compare the old value. I know that the package[] ensure can be set to a specific value, but I can't do that because the packages we have for RHEL are 3.5.x but the packages I had to pull for SLES 11 (...) are 3.6.x, etc. I don't want to ensure a specific version, just a minimum version somewhat similar to PUP-1519[1]. [1] https://tickets.puppetlabs.com/browse/PUP-1519

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>