-
-
Notifications
You must be signed in to change notification settings - Fork 269
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
Collectd network plugin requires two puppet runs #162
Comments
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 |
Yeah I haven’t thought of a good solution yet for this problem. It affects all the plugins that check for collectd version. |
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 ? |
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. |
We could add |
Add a section to explain version scoping & known issue for #162
Any work around about this issue ? --later : Facter.add("collectd_version") do |
Here is another suggestion:
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. 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 What do you think? If you think its worthwhile I can attempt a pull request. |
This change includes a workaround for a bug [1] found in the upstream puppet-collectd module. [1] voxpupuli/puppet-collectd#162 Change-Id: I560e0436cfefb026d2c7a979091208a399bbe2fd
@johnf, @txaj, @jpoittevin, @ngagecj: |
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 |
…tions When an administrator knows the version of collectd that will be used or at least the minimum version available the need for two puppet runs before convergence can be avoided or at least minimised. Instead of using the fact in the templates they now use a class variable set to one of (in priority order): * collectd_version (i.e. the fact) * version (the semver matched part of it only) * minimum_version (undef by default) Existing behaviour is preserved except for a corner case where version is set to something specific and collectd is not yet installed. In this case puppet will only take one run and assume the version specified when creating the templates references voxpupuli#162
@txaj: I've raised the PR as requested. |
…tions When an administrator knows the version of collectd that will be used or at least the minimum version available the need for two puppet runs before convergence can be avoided or at least minimised. Instead of using the fact in the templates they now use a class variable set to one of (in priority order): * collectd_version (i.e. the fact) * version (the semver matched part of it only) * minimum_version (undef by default) Existing behaviour is preserved except for a corner case where version is set to something specific and collectd is not yet installed. In this case puppet will only take one run and assume the version specified when creating the templates references voxpupuli#162
…tions When an administrator knows the version of collectd that will be used or at least the minimum version available the need for two puppet runs before convergence can be avoided or at least minimised. Instead of using the fact in the templates they now use a class variable set to one of (in priority order): * collectd_version (i.e. the fact) * version (the semver matched part of it only) * minimum_version (undef by default) Existing behaviour is preserved except for a corner case where version is set to something specific and collectd is not yet installed. In this case puppet will only take one run and assume the version specified when creating the templates references voxpupuli#162
Rebased to current master |
…tions When an administrator knows the version of collectd that will be used or at least the minimum version available the need for two puppet runs before convergence can be avoided or at least minimised. Instead of using the fact in the templates they now use a class variable set to one of (in priority order): * collectd_version (i.e. the fact) * version (the semver matched part of it only) * minimum_version (undef by default) Existing behaviour is preserved except for a corner case where version is set to something specific and collectd is not yet installed. In this case puppet will only take one run and assume the version specified when creating the templates references voxpupuli#162
…tions When an administrator knows the version of collectd that will be used or at least the minimum version available the need for two puppet runs before convergence can be avoided or at least minimised. Instead of using the fact in the templates they now use a class variable set to one of (in priority order): * collectd_version (i.e. the fact) * version (the semver matched part of it only) * minimum_version (undef by default) Existing behaviour is preserved except for a corner case where version is set to something specific and collectd is not yet installed. In this case puppet will only take one run and assume the version specified when creating the templates references voxpupuli#162
…tions When an administrator knows the version of collectd that will be used or at least the minimum version available the need for two puppet runs before convergence can be avoided or at least minimised. Instead of using the fact in the templates they now use a class variable set to one of (in priority order): * collectd_real_version (i.e. the fact) * version (the semver matched part of it only) * minimum_version (undef by default) Existing behaviour is preserved except for a corner case where version is set to something specific and collectd is not yet installed. In this case puppet will only take one run and assume the version specified when creating the templates references voxpupuli#162
…tions When an administrator knows the version of collectd that will be used or at least the minimum version available the need for two puppet runs before convergence can be avoided or at least minimised. Instead of using the fact in the templates they now use a class variable set to one of (in priority order): * collectd_real_version (i.e. the fact) * version (the semver matched part of it only) * minimum_version (undef by default) Existing behaviour is preserved except for a corner case where version is set to something specific and collectd is not yet installed. In this case puppet will only take one run and assume the version specified when creating the templates references voxpupuli#162
…tions When an administrator knows the version of collectd that will be used or at least the minimum version available the need for two puppet runs before convergence can be avoided or at least minimised. Instead of using the fact in the templates they now use a class variable set to one of (in priority order): * collectd_real_version (i.e. the fact) * version (the semver matched part of it only) * minimum_version (undef by default) Existing behaviour is preserved except for a corner case where version is set to something specific and collectd is not yet installed. In this case puppet will only take one run and assume the version specified when creating the templates references voxpupuli#162
…tions When an administrator knows the version of collectd that will be used or at least the minimum version available the need for two puppet runs before convergence can be avoided or at least minimised. Instead of using the fact in the templates they now use a class variable set to one of (in priority order): * collectd_real_version (i.e. the fact) * version (the semver matched part of it only) * minimum_version (undef by default) Existing behaviour is preserved except for a corner case where version is set to something specific and collectd is not yet installed. In this case puppet will only take one run and assume the version specified when creating the templates references #162
with the closing of #305 can we close this issue, too? |
https://github.com/pdxcat/puppet-module-collectd/blob/master/templates/plugin/network.conf.erb#L3
This depends on collectd_version. The fact is being evaluated at catalog compile time which is before collectd is installed. So it probably ends up as nil, so the SecurityLevel isn't set.
Then on a second run when it detects collectd 5 is installed then it adds the SecurityLevel
Not sure what a good solution to this problem is though. Maybe the fact could work out what version is going to be installed? Something like
The text was updated successfully, but these errors were encountered: