-
Notifications
You must be signed in to change notification settings - Fork 241
Feature: #947 add facter.conf management of blocklist, cache #950
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
Closed
+79
−1
Closed
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
dc99d1d
enable management of facter blocking caching
9ee1f6c
Test parameter location to try to remove top scope depeendcy
8e3f814
corrected fact formatting inline with style guide
ikonia 15f6331
set variables back to parameters
ikonia b4aa199
change variable root to params.pp
ikonia 15253e8
define facter parameters for use
ikonia 557c88c
strip trailing parameter comma
ikonia b7fec5b
includ hocon module as dependency
ikonia 65c4943
formatting and linting tidy
ikonia 3323c41
declare variables directly in facter.pp
ikonia 04439aa
remove facter_blocklist parameters from class scope
ikonia 5b11968
syntax tidy up
ikonia fe715e5
add missing comma to new dependency definition
ikonia 57a59e4
syntax clean up
ikonia 33439fd
strip empty line, style compliance
ikonia 6ecd129
correct additional white space, style compliance
ikonia da167fd
removed top scope test value for lint testing
ikonia d14d800
reformat whitespaces, style guide
ikonia 5be11e3
strip trailing i of facter.conf value
ikonia 212a699
test-suit linter style update
ikonia 8cf1db8
Functionally Complete
cc85a18
fix missed linting of parameter ordering
ae857e5
fix additional parameter ordering error
db5be24
remove conditional puppet version check and brace tidy
3d03342
refactor identing post if statement removeal
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,73 @@ | ||
| # Puppet agent facter configuration | ||
| # @api private | ||
| class puppet::agent::facter ( | ||
| Optional[Array[String]] $blocklist = undef, | ||
| Optional[Array[String]] $cachelist = undef, | ||
| String $cache_ttl = '1 day', | ||
| ) { | ||
| file { '/etc/puppetlabs/facter': | ||
| ensure => directory, | ||
| } | ||
|
|
||
| hocon_setting { 'facter.conf': | ||
| path => '/etc/puppetlabs/facter/facter.conf', | ||
| require => File['/etc/puppetlabs/facter'], | ||
|
Member
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. I'd wish |
||
| setting => 'managed', | ||
| value => 'puppet', | ||
| } | ||
|
|
||
| if $blocklist { | ||
| hocon_setting { 'blocklist facts group': | ||
| ensure => present, | ||
| path => '/etc/puppetlabs/facter/facter.conf', | ||
| setting => 'fact-groups.blocked-facts', | ||
| value => $blocklist, | ||
| type => 'array', | ||
| } | ||
| -> hocon_setting { 'blocklist facts': | ||
| ensure => present, | ||
| path => '/etc/puppetlabs/facter/facter.conf', | ||
| setting => 'facts.blocklist', | ||
| value => ['blocked-facts'], | ||
| type => 'array', | ||
| } | ||
| } else { | ||
| hocon_setting { 'blocklist facts group': | ||
| ensure => absent, | ||
| path => '/etc/puppetlabs/facter/facter.conf', | ||
| setting => 'fact-groups.blocked-facts', | ||
| } | ||
| hocon_setting { 'blocklist facts': | ||
| ensure => absent, | ||
| path => '/etc/puppetlabs/facter/facter.conf', | ||
| setting => 'facts.blocklist', | ||
| } | ||
| } | ||
| if $cachelist { | ||
| hocon_setting { 'cachelist facts group': | ||
| ensure => present, | ||
| path => '/etc/puppetlabs/facter/facter.conf', | ||
| setting => 'fact-groups.cached-facts', | ||
| value => $cachelist, | ||
| type => 'array', | ||
| } | ||
| -> hocon_setting { 'cachelist facts': | ||
| ensure => present, | ||
| path => '/etc/puppetlabs/facter/facter.conf', | ||
| setting => 'facts.ttls', | ||
| value => [{ 'cached-facts' => $cache_ttl }], | ||
| type => 'array', | ||
| } | ||
| } else { | ||
| hocon_setting { 'cachelist facts group': | ||
| ensure => absent, | ||
| path => '/etc/puppetlabs/facter/facter.conf', | ||
| setting => 'fact-groups.cached-facts', | ||
| } | ||
| hocon_setting { 'cachelist facts': | ||
| ensure => absent, | ||
| path => '/etc/puppetlabs/facter/facter.conf', | ||
| setting => 'facts.ttls', | ||
| } | ||
| } | ||
| } | ||
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
Oops, something went wrong.
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.
Please introduce the base directory as a parameter to allow for non-AIO builds.