Comments (12)
I agree with you, but your suggestion depends too much on the provider used by the package type.
I can't think of a better way to do either
from puppet-collectd.
Yeah I haven’t thought of a good solution yet for this problem. It affects all the plugins that check for collectd version.
from puppet-collectd.
When I look on how we use this fact, it appear we are discriminating against a rather big version number. Couldn't we take the approach of discriminating against ::lsbdistrelease ?
from puppet-collectd.
I'm not sure it will be enough. If one uses a special repository, he could have a different version of collectd than the one expected with a given dist.
from puppet-collectd.
We could add $::lsbdistcodename
version defaults and allow it to be overridden by the user but then we have to maintain a list for the life time of the module which is not very appealing.
from puppet-collectd.
Any work around about this issue ?
--later :
I have found a small work around that works for me. I have created a facter script to overwrite the collectd_version in order that the plugins to be placed at the first run of puppet.
Facter.add("collectd_version") do
setcode do
"5.4.1-1.7.amzn1"
end
end
from puppet-collectd.
Here is another suggestion:
instead of using the fact directly in the ERB templates, why not use a class variable (e.g. $_collectd_version
) which is set based on one of the following sources:
$version
(if it represents an explicit version - major.minor.revision parts only)$collectd_version
fact, if not undef / nil- default version supplied from hiera or minimum version supported by this module
This permits the system administrator to use an explicit version for the package and get a single puppet run and/or to supply a default minimum version if these are not set.
e.g. assuming class with defaults as follows (untested)
class collectd(
...
$version = installed,
$collectd_default_version = '5.0.0',
) inherits collectd::params {
...
$_collectd_version = pick( regsubst($version, '^\d+\.\d+\.\d+', '\0'), $collectd_version, $collectd_default_version)
...
}
Then use $_collectd_version
in the ERB templates.
What do you think? If you think its worthwhile I can attempt a pull request.
from puppet-collectd.
@johnf, @txaj, @jpoittevin, @ngagecj:
Any comment on my potential solution above? I'm happy to create a PR if its considered reasonable.
Thanks
from puppet-collectd.
This is a great idea!
In your PR you may want 1/ not to break compatibility by setting the $collectd_default_version to undef, so it'll still need two runs if not explicitly configured 2/ document this feature both in the "usage" section and down the README with a format like "Puppet needs two runs to correctly write my conf, why ?" and refer to this issue
from puppet-collectd.
@txaj: I've raised the PR as requested.
I've tested this but it relies upon the user loading the collectd class before instantiating any plugin classes. I'm not sure there's a way around this.
Tests for the plugins have been updated but there isn't an easy way of testing the version selector as its only exposed by an internal variable.
Thoughts?
from puppet-collectd.
Rebased to current master
from puppet-collectd.
with the closing of #305 can we close this issue, too?
from puppet-collectd.
Related Issues (20)
- File['collectd.d'] -> Concat <| tag == 'collectd' |> is too greedy HOT 2
- collectd::plugin::rabbitmq manifest - Should have a OS test override option
- When can we expect a new version?
- service.pp incorrectly references static service name HOT 1
- plugin_conf_dir_mode too strict for /usr/lib/python2.7/site-packages/ HOT 1
- Hiera Support HOT 4
- ProcEvent plugin uses ProcessRegex instead of RegexProcess
- Puppet needs to run twice to apply CollectD configuration HOT 3
- Error with Plugin "Load" with collectd-5.9 and RHEL-8 HOT 1
- Migrate to module level hiera data.
- processes-config.conf file is not created HOT 10
- [Feature Request] Expose collectd::plugin::order to defined plugin classes
- collectd fails to load when using multiple hostname format values
- ovs_stats port number mismatch
- Python plugin template does not create valid module configuration
- collectd::plugin::virt plugin_instance_format should not be Enum
- postgresql plugin does not produce working database configuration with writer query
- [release request] v12.3.0 HOT 3
- Add Chrony Plugin
- Upgrade puppet-epel version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-collectd.