Skip to content

Commit 7344e3f

Browse files
jcekohl
authored andcommitted
Allow disabling CRL checking on agent
In extrernal CA configurations, it is possible that a CRL is not present on the server. This allows to tell the agent to skip downloading it and checking it.
1 parent 47568f2 commit 7344e3f

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

manifests/config.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
$auth_allowed = $puppet::auth_allowed,
77
$ca_server = $puppet::ca_server,
88
$ca_port = $puppet::ca_port,
9+
$certificate_revocation = $puppet::certificate_revocation,
910
$dns_alt_names = $puppet::dns_alt_names,
1011
$module_repository = $puppet::module_repository,
1112
$pluginsource = $puppet::pluginsource,
@@ -39,6 +40,9 @@
3940
if $ca_port {
4041
puppet::config::main { 'ca_port': value => $ca_port; }
4142
}
43+
if $certificate_revocation != undef {
44+
puppet::config::main { 'certificate_revocation': value => $certificate_revocation; }
45+
}
4246
if $dns_alt_names and !empty($dns_alt_names) {
4347
puppet::config::main { 'dns_alt_names': value => $dns_alt_names; }
4448
}

manifests/init.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@
8989
# $ca_crl_filepath:: Path to CA CRL file, dynamically resolves based on
9090
# $::server_ca status.
9191
#
92+
# $certificate_revocation:: Whether certificate revocation checking should be
93+
# enabled, and what level of checking should be performed
94+
#
9295
# $dns_alt_names:: Use additional DNS names when generating a
9396
# certificate. Defaults to an empty Array.
9497
#
@@ -611,6 +614,7 @@
611614
Optional[Variant[String, Boolean]] $ca_server = $puppet::params::ca_server,
612615
Optional[Stdlib::Port] $ca_port = $puppet::params::ca_port,
613616
Optional[String] $ca_crl_filepath = $puppet::params::ca_crl_filepath,
617+
Optional[Variant[Boolean, Enum['chain', 'leaf']]] $certificate_revocation = $puppet::params::certificate_revocation,
614618
Optional[String] $prerun_command = $puppet::params::prerun_command,
615619
Optional[String] $postrun_command = $puppet::params::postrun_command,
616620
Array[String] $dns_alt_names = $puppet::params::dns_alt_names,

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
$ca_server = undef
2828
$ca_port = undef
2929
$ca_crl_filepath = undef
30+
$certificate_revocation = undef
3031
$server_crl_enable = undef
3132
$prerun_command = undef
3233
$postrun_command = undef

spec/classes/puppet_init_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,22 @@
8787
it { should contain_puppet__config__main('ca_port').with_value(8140) }
8888
end
8989

90+
describe 'with undef certificate_revocation' do
91+
let :params do {
92+
:certificate_revocation => :undef,
93+
} end
94+
95+
it { should_not contain_puppet__config__main('certificate_revocation') }
96+
end
97+
98+
describe 'with certificate_revocation' do
99+
let :params do {
100+
:certificate_revocation => 'leaf',
101+
} end
102+
103+
it { should contain_puppet__config__main('certificate_revocation').with_value('leaf') }
104+
end
105+
90106
describe 'with puppetconf_mode' do
91107
let :params do {
92108
:puppetconf_mode => '0640',

0 commit comments

Comments
 (0)