-
Notifications
You must be signed in to change notification settings - Fork 232
Add support for enabling puppetdb report processor #64
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
Merged
kbarber
merged 5 commits into
puppetlabs:master
from
cprice404:feature/master/support-enabling-report-processor
May 28, 2013
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
148bddb
Add support for enabling puppetdb report processor
cprice404 68f2889
Update README, add rspec-puppet tests
cprice404 9f2583a
Update Modulefile / CHANGELOG for 1.4.0 release
cprice404 805b7f1
Update inifile dependency to latest version
cprice404 8383020
Bump inifile module dependency version once more
cprice404 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Class: puppetdb::master::report_processor | ||
| # | ||
| # This class configures the puppet master to enable the puppetdb report | ||
| # processor | ||
|
|
||
| # Parameters: | ||
| # ['puppet_conf'] - The puppet config file (defaults to /etc/puppet/puppet.conf) | ||
| # | ||
| # Actions: | ||
| # - Configures the puppet master to use the puppetdb report processor | ||
| # | ||
| # Requires: | ||
| # - Inifile | ||
| # | ||
| # Sample Usage: | ||
| # class { 'puppetdb::master::report_processor': | ||
| # puppet_conf => '/etc/puppet/puppet.conf', | ||
| # enable => true | ||
| # } | ||
| # | ||
| # | ||
| class puppetdb::master::report_processor( | ||
| $puppet_conf = $puppetdb::params::puppet_conf, | ||
| $enable = false | ||
| ) inherits puppetdb::params { | ||
|
|
||
| ini_subsetting { "puppet.conf/reports/puppetdb": | ||
| path => $puppet_conf, | ||
| section => 'master', | ||
| setting => 'reports', | ||
| subsetting => 'puppetdb', | ||
| subsetting_separator => ',', | ||
| ensure => $enable ? { true => present, default => absent } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,4 +43,27 @@ class { 'puppetdb::master::config': } | |
| end | ||
| end | ||
| end | ||
|
|
||
| describe 'enabling report processor' do | ||
| let(:pp) do | ||
| pp = <<-EOS | ||
| class { 'puppetdb::master::config': | ||
| manage_report_processor => true, | ||
| enable_reports => true | ||
| } | ||
| EOS | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You didn't close the 'let' here.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aha! thx. kind of surprised that didn't throw an error. |
||
|
|
||
| it 'should add the puppetdb report processor to puppet.conf' do | ||
| puppet_apply(pp) do |r| | ||
| r[:exit_code].should_not eq(1) | ||
| end | ||
|
|
||
| system_run("cat /etc/puppet/puppet.conf") do |r| | ||
| r[:stdout].should =~ /^reports\s*=\s*([^,]+,)*puppetdb(,[^,]+)*$/ | ||
| end | ||
| end | ||
|
|
||
| end | ||
| end | ||
|
|
||
| end | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We keep copying this non-standard puppet doc header ... this is the style we should follow: http://docs.puppetlabs.com/guides/style_guide.html#puppet-doc but we probably need to do this everywhere as well. Its just that running this kind of header through rdoc makes it look terrible. Not a big deal of course, just thought I'd mention it.
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.
@kbarber is it the missing equals signs that you're referring to?
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.
No I mean the entire comment for the 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.
OK, but I'm only seeing minor differences between what you linked to and what's in this code. Namely: equals signs for headers, asterisks around parameter names... that's pretty much it?
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.
@cprice-puppet yeah thats about right, names of header sections as well are different (for example 'actions' could just be in the main description, and its 'examples' instead of sample usage). The parameters section renders differently using the format in the style guide also. While it looks like small differences, the difference in rendering makes it more presentable when put through the 'puppet doc' tool. Its not a big deal like I said, I'm happy to do a cleanup of all of this later if you like - getting all the classes, since I'm the one being pedantic :-).