Skip to content

Commit

Permalink
Merge if/else branch into a single resource declaration
Browse files Browse the repository at this point in the history
This always defined the same file, just with a different source. That
source is either the provided server_ca_cert or the default CA.
  • Loading branch information
ekohl committed Sep 12, 2024
1 parent 56f8921 commit a236b33
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions manifests/ca.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,12 @@
build_dir => $certs::ssl_build_dir,
}

if $certs::server_ca_cert {
file { $server_ca_path:
ensure => file,
source => $certs::server_ca_cert,
owner => 'root',
group => 'root',
mode => '0644',
}
} else {
file { $server_ca_path:
ensure => file,
source => $default_ca_path,
owner => 'root',
group => 'root',
mode => '0644',
}
file { $server_ca_path:
ensure => file,
source => pick($certs::server_ca_cert, $default_ca_path),
owner => 'root',
group => 'root',
mode => '0644',
}

if $generate {
Expand Down

0 comments on commit a236b33

Please sign in to comment.