Skip to content

Commit

Permalink
fix #653 Allow to send cert req without ticket
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz committed Mar 4, 2021
1 parent b6f9ede commit d284b01
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions manifests/feature/api.pp
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,11 @@
$cmd_pki_get_cert = "\"${icinga2_bin}\" pki save-cert --host ${ca_host} --port ${ca_port} --key ${_ssl_key_path} --cert ${_ssl_cert_path} --trustedcert ${trusted_cert}"

if($ticket_id) {
$_ticket_id = $ticket_id
$_ticket = "--ticket ${ticket_id}"
} elsif($ticket_salt != 'TicketSalt') {
$_ticket_id = icinga2_ticket_id($node_name, $ticket_salt)
$_ticket = "--ticket ${icinga2_ticket_id($node_name, $ticket_salt)}"
} else {
fail("Parameter ticket_salt or ticket_id has be set when using pki='icinga2'")
$_ticket = ''
}
if $fingerprint {
$_fingerprint = upcase(regsubst($fingerprint, ':', ' ', 'G'))
Expand Down Expand Up @@ -329,7 +329,7 @@
}

-> exec { 'icinga2 pki request':
command => "\"${icinga2_bin}\" pki request --host ${ca_host} --port ${ca_port} --ca ${_ssl_cacert_path} --key ${_ssl_key_path} --cert ${_ssl_cert_path} --trustedcert ${trusted_cert} --ticket ${_ticket_id}", # lint:ignore:140chars
command => "\"${icinga2_bin}\" pki request --host ${ca_host} --port ${ca_port} --ca ${_ssl_cacert_path} --key ${_ssl_key_path} --cert ${_ssl_cert_path} --trustedcert ${trusted_cert} ${_ticket}", # lint:ignore:140chars
creates => $_ssl_cacert_path,
}
} # icinga2
Expand Down

0 comments on commit d284b01

Please sign in to comment.