-
-
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
Improve version handling to avoid multiple puppet runs for some situa… #305
Improve version handling to avoid multiple puppet runs for some situa… #305
Conversation
PIng @txaj for review |
Is it possible to write a spec test to test the new behavior? |
193a792
to
89ed12e
Compare
Hi @blkperl, I'd like to add tests for the new functionality but I'm very new to puppet-rspec and I'm not sure how. Specifically I'm having difficulty accessing the |
###Puppet needs two runs to correctly write my conf, why? | ||
|
||
Some plugins will need two runs of Puppet to fully generate the configuration for collectd. See [this issue](https://github.com/pdxcat/puppet-module-collectd/issues/162). | ||
This can be avoided by specifying an explicit version (`$version`) or a minimum version (`$minimum_version`) to the collectd class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you be more explicit about how this parameter works ? like "setting this parameter to 9.99 will makes this module assume at the first run (when the fact responsible to provide the collectd version is not yet avaibable) that your systems are running collectd 9.99, and generate the configuration accordingly"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure will do
@bdellegrazie for testing I only see one way : take a module that generates a different configuration depending on the collectd version, and test the output when you set the fact to undef/value1/value2 and the default to undef/value1/value2 and check that it makes sense |
89ed12e
to
c95caea
Compare
69b4a8c
to
43399b9
Compare
…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
43399b9
to
8c5e8ba
Compare
@txaj, @blkperl: I've updated the PR to do the following:
I had to use a test module in the fixtures dir to be able to create the tests around the collect_version but they do work. |
thanks @bdellegrazie and @txaj! i've merged this manually. |
since merging this, we now have a failing test @bdellegrazie do i understand it correctly, that we should be checking for collectd_real_version here (as well as in the code)? |
yes the fact should be collectd_real_version - I thought it was on my On 28 September 2015 at 16:15, Igor Galić notifications@github.com wrote:
Kind regards, Brett Delle Grazie |
Okay, I realise someone has added more tests (great!) but when merging the On 28 September 2015 at 16:41, Brett Delle Grazie <
Kind regards, Brett Delle Grazie |
* When PR voxpupuli#305 was merged to master, it was based on an older master branch A couple of tests had been added to the init class that were not updated with the merge. This commit fixes those two tests
* When PR voxpupuli#305 was merged to master, it was based on an older master branch A couple of tests had been added to the init class that were not updated with the merge. This commit fixes those two tests
* When PR voxpupuli#305 was merged to master, it was based on an older master branch A couple of tests had been added to the init class that were not updated with the merge. This commit fixes those two tests
@bdellegrazie did i do a poor job of rebasing / merging your branch? |
…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):
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