Details
-
Story
-
Status: Resolved
-
Low
-
Resolution: Fixed
-
SERVER 6.7.0
-
OSP puppetserver 6.7.1 with a CA master and 3 compile masters behind a loadbalancer.
-
Froyo
-
Bug Fix
-
The `puppetserver ca list` command will now exit 1 when run on a non-CA server.
-
Needs Assessment
Description
Use case: I'm working on some scripting to run a puppetserver ca command. I want to put in a safeguard to prevent someone from running a CA command on a compile master. The notion I had was to detect the ca-master by looking at the CA.
A CA master runs puppetserver ca list --all just like you would expect. On the compile masters, though:
# puppetserver ca list --all
|
Error:
|
code: 403 |
body: Forbidden request: /puppet-ca/v1/certificate_statuses/any_key (method :get). Please see the server logs for details. |
No certificates to list
|
|
# echo $?
|
0 |
Since everything about that query was a failure, I would expect an error code to be returned. Instead the error is all in the text. While obvious to a human that this failed, with it having exited 0 we're into grepping text to find that the command failed.