-
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
base: master
Are you sure you want to change the base?
Changes from 19 commits
dc99d1d
9ee1f6c
8e3f814
15f6331
b4aa199
15253e8
557c88c
b7fec5b
65c4943
3323c41
04439aa
5b11968
fe715e5
57a59e4
33439fd
6ecd129
da167fd
d14d800
5be11e3
212a699
8cf1db8
cc85a18
ae857e5
db5be24
3d03342
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # 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', | ||
| ) { | ||
|
|
||
| if versioncmp(fact('aio_agent_version'),'7') >= 0 { | ||
| file { '/etc/puppetlabs/facter': | ||
| ensure => directory, | ||
| } | ||
|
|
||
| hocon_setting { 'facter.conf': | ||
| path => '/etc/puppetlabs/facter/facter.conf', | ||
| require => File['/etc/puppetlabs/facter'], | ||
| } | ||
|
|
||
| if $blocklist { | ||
| hocon_setting { 'blocklist facts group': | ||
|
||
| ensure => present, | ||
| setting => 'fact-groups.blocked-facts', | ||
| value => $blocklist, | ||
| type => 'array', | ||
| } | ||
| -> hocon_setting { 'blocklist facts': | ||
| ensure => present, | ||
| setting => 'facts.blocklist', | ||
| value => ['blocked-facts'], | ||
| type => 'array', | ||
| } | ||
| } else { | ||
| hocon_setting { 'blocklist facts group': | ||
| ensure => absent, | ||
| setting => 'fact-groups.blocked-facts', | ||
| } | ||
| hocon_setting { 'blocklist facts': | ||
| ensure => absent, | ||
| setting => 'facts.blocklist', | ||
| } | ||
| } | ||
| if $cachelist { | ||
| hocon_setting { 'cachelist facts group': | ||
| ensure => present, | ||
| setting => 'fact-groups.cached-facts', | ||
| value => $cachelist, | ||
| type => 'array', | ||
| } | ||
| -> hocon_setting { 'cachelist facts': | ||
| ensure => present, | ||
| setting => 'facts.ttls', | ||
| value => [{'cached-facts' => $cache_ttl }], | ||
| type => 'array', | ||
| } | ||
| } else { | ||
| hocon_setting { 'cachelist facts group': | ||
| ensure => absent, | ||
| setting => 'fact-groups.cached-facts', | ||
| } | ||
| hocon_setting { 'cachelist facts': | ||
| ensure => absent, | ||
| setting => 'facts.ttls', | ||
| } | ||
| } | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.