Skip to content
Open
Show file tree
Hide file tree
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
Sep 1, 2025
9ee1f6c
Test parameter location to try to remove top scope depeendcy
Sep 1, 2025
8e3f814
corrected fact formatting inline with style guide
ikonia Sep 1, 2025
15f6331
set variables back to parameters
ikonia Sep 1, 2025
b4aa199
change variable root to params.pp
ikonia Sep 1, 2025
15253e8
define facter parameters for use
ikonia Sep 1, 2025
557c88c
strip trailing parameter comma
ikonia Sep 1, 2025
b7fec5b
includ hocon module as dependency
ikonia Sep 1, 2025
65c4943
formatting and linting tidy
ikonia Sep 1, 2025
3323c41
declare variables directly in facter.pp
ikonia Sep 2, 2025
04439aa
remove facter_blocklist parameters from class scope
ikonia Sep 2, 2025
5b11968
syntax tidy up
ikonia Sep 2, 2025
fe715e5
add missing comma to new dependency definition
ikonia Sep 2, 2025
57a59e4
syntax clean up
ikonia Sep 2, 2025
33439fd
strip empty line, style compliance
ikonia Sep 2, 2025
6ecd129
correct additional white space, style compliance
ikonia Sep 2, 2025
da167fd
removed top scope test value for lint testing
ikonia Sep 2, 2025
d14d800
reformat whitespaces, style guide
ikonia Sep 2, 2025
5be11e3
strip trailing i of facter.conf value
ikonia Sep 2, 2025
212a699
test-suit linter style update
ikonia Sep 2, 2025
8cf1db8
Functionally Complete
Sep 3, 2025
cc85a18
fix missed linting of parameter ordering
Sep 3, 2025
ae857e5
fix additional parameter ordering error
Sep 3, 2025
db5be24
remove conditional puppet version check and brace tidy
Sep 3, 2025
3d03342
refactor identing post if statement removeal
Sep 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion manifests/agent.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
class puppet::agent {
contain puppet::agent::install
contain puppet::agent::config
contain puppet::agent::facter
contain puppet::agent::service

Class['puppet::agent::install'] ~> Class['puppet::agent::config', 'puppet::agent::service']
Class['puppet::agent::install'] ~> Class['puppet::agent::config', 'puppet::agent::facter', 'puppet::agent::service']
Class['puppet::config', 'puppet::agent::config'] ~> Class['puppet::agent::service']
}
73 changes: 73 additions & 0 deletions manifests/agent/facter.pp
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'],
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',
}
}
}
4 changes: 4 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"name": "theforeman-puppet",
"version": "21.1.0",
Expand Down Expand Up @@ -30,6 +30,10 @@
{
"name": "puppet/systemd",
"version_requirement": ">= 2.9.0 < 9.0.0"
},
{
"name": "puppetlabs/hocon",
"version_requirement": ">= 1.1.0 < 2.0.0"
}
],
"requirements": [
Expand Down
Loading