Skip to content

Commit 9f2da4b

Browse files
author
Kevin Paulisse
committed
Correct documentation for PuppetDB SSL client configuration
1 parent 68b4977 commit 9f2da4b

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

doc/configuration-puppetdb.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ The following settings can be used in a [configuration file](/doc/configuration.
2424
| --- | --- |
2525
| `settings[:puppetdb_url]` | PuppetDB URL settings. If this is a string, it will set a single PuppetDB URL. If it is an array, it will set multiple URLs, which will be tried in a random order until one responds. |
2626
| `settings[:puppetdb_ssl_ca]` | Path to the certificate of the CA that signed PuppetDB's certificate. This file is typically found in `/etc/puppetlabs/puppetdb/ssl/ca.pem` on your PuppetDB server. This file should contain only the public certificate, so it is safe to distribute to developer workstations or CI environments. |
27-
| `settings[:puppetdb_ssl_client_cert]` | Path to the certificate of the client SSL keypair. You should generate a keypair specifically for this client (or if you are running this on a machine managed by Puppet, you may be able to use the keypair for the client machine). You should **NOT** copy the certificate from your PuppetDB server itself. |
28-
| `settings[:puppetdb_ssl_client_key]` | Path to the private key of the client SSL keypair. You should generate a keypair specifically for this client (or if you are running this on a machine managed by Puppet, you may be able to use the keypair for the client machine). You should **NOT** copy the private key from your PuppetDB server itself. |
27+
| `settings[:puppetdb_ssl_client_cert]` | TEXT of the certificate of the client SSL keypair. You should generate a keypair specifically for this client (or if you are running this on a machine managed by Puppet, you may be able to use the keypair for the client machine). You should **NOT** copy the certificate from your PuppetDB server itself. Note: This variable needs to be set to the TEXT of the certificate, and not the file path. This means you will likely want to use `File.read(...)` if you are configuring this to be read from a file. |
28+
| `settings[:puppetdb_ssl_client_key]` | Path to the private key of the client SSL keypair. You should generate a keypair specifically for this client (or if you are running this on a machine managed by Puppet, you may be able to use the keypair for the client machine). You should **NOT** copy the private key from your PuppetDB server itself. Note: This variable needs to be set to the TEXT of the key, and not the file path. This means you will likely want to use `File.read(...)` if you are configuring this to be read from a file. |
29+
| `settings[:puppetdb_ssl_client_pem]` | Concatenation of the text of `puppetdb_ssl_client_key` and `puppetdb_ssl_client_cert` as previously described. This is a good alternative if your certificate chain is complex and it's easier just to put everything in a single place. Note: this option is second in precedence; if `settings[:puppetdb_ssl_client_cert]` and `settings[:puppetdb_ssl_client_key]` are both set, this will be ignored. |
2930
| `settings[:puppetdb_ssl_client_password]` | Plain text string containing the password to unlock the private key. For keys generated by the Puppet Master CA, this is not required and should be left undefined. |
3031

3132
## Supplying necessary information via the command line

examples/octocatalog-diff.cfg.rb

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,33 @@ def self.config
7676
# puppetdb_ssl_client_key
7777
# puppetdb_ssl_client_password
7878
# puppetdb_ssl_client_cert
79+
# puppetdb_ssl_client_pem
80+
#
81+
# This sets up SSL authentication for PuppetDB.
82+
#
7983
# For SSL authentication, the key and certificate used for SSL client authentication.
8084
# Don't set these if your PuppetDB is unauthenticated. The provided example may work if you
8185
# run octocatalog-diff on a machine managed by Puppet, and your PuppetDB authenticates
82-
# clients with that same CA. Otherwise, just provide the actual path to the key and the
86+
# clients with that same CA. Otherwise, fill in the actual path to the key and the
8387
# certificate in the relevant settings. If the key is password protected, set
8488
# :puppetdb_ssl_client_password to the text of the password.
89+
#
90+
# You can configure this in one of two ways:
91+
# 1. Set `puppetdb_ssl_client_key` and `puppetdb_ssl_client_cert` individually.
92+
# 2. Set `puppetdb_ssl_client_pem` to the concatenation of the key and the certificate.
93+
#
94+
# VERY IMPORTANT: settings[:puppetdb_ssl_client_key], settings[:puppetdb_ssl_client_cert], and
95+
# settings[:puppetdb_ssl_client_pem] need to be set to the TEXT OF THE CERTIFICATE/KEY, not
96+
# just the file name of the certificate. You'll probably need to use something like this:
97+
# settings[:puppetdb_ssl_client_WHATEVER] = File.read("...")
98+
#
8599
# More: https://github.com/github/octocatalog-diff/blob/master/doc/configuration-puppetdb.md
86100
##############################################################################################
87101

88102
# require 'socket'
89103
# fqdn = Socket.gethostbyname(Socket.gethostname).first
90-
# settings[:puppetdb_ssl_client_key] = "/etc/puppetlabs/puppet/ssl/private_keys/#{fqdn}.pem"
91-
# settings[:puppetdb_ssl_client_cert] = "/etc/puppetlabs/puppet/ssl/certs/#{fqdn}.pem"
104+
# settings[:puppetdb_ssl_client_key] = File.read("/etc/puppetlabs/puppet/ssl/private_keys/#{fqdn}.pem")
105+
# settings[:puppetdb_ssl_client_cert] = File.read("/etc/puppetlabs/puppet/ssl/certs/#{fqdn}.pem")
92106
# settings[:puppetdb_ssl_client_password] = 'your-password-here'
93107

94108
##############################################################################################

0 commit comments

Comments
 (0)