Skip to content

Commit a236b33

Browse files
committed
Merge if/else branch into a single resource declaration
This always defined the same file, just with a different source. That source is either the provided server_ca_cert or the default CA.
1 parent 56f8921 commit a236b33

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

manifests/ca.pp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,12 @@
4646
build_dir => $certs::ssl_build_dir,
4747
}
4848

49-
if $certs::server_ca_cert {
50-
file { $server_ca_path:
51-
ensure => file,
52-
source => $certs::server_ca_cert,
53-
owner => 'root',
54-
group => 'root',
55-
mode => '0644',
56-
}
57-
} else {
58-
file { $server_ca_path:
59-
ensure => file,
60-
source => $default_ca_path,
61-
owner => 'root',
62-
group => 'root',
63-
mode => '0644',
64-
}
49+
file { $server_ca_path:
50+
ensure => file,
51+
source => pick($certs::server_ca_cert, $default_ca_path),
52+
owner => 'root',
53+
group => 'root',
54+
mode => '0644',
6555
}
6656

6757
if $generate {

0 commit comments

Comments
 (0)