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 authored and ehelms committed Oct 15, 2024
1 parent 9824c7a commit bbeedaf
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 @@ -47,22 +47,12 @@
}

if $generate {
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',
}

file { "${certs::ssl_build_dir}/KATELLO-TRUSTED-SSL-CERT":
Expand Down

0 comments on commit bbeedaf

Please sign in to comment.