You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: allow to pass additional HTTP headers in puppetdb requests
This can be useful if you want to access PuppetDB via custom authentication.
Eg if you want to access PuppetDB behind an API gateway that requires oauth tokens
or other custom headers.
Copy file name to clipboardExpand all lines: documentation/bolt_connect_puppetdb.md
+16-5Lines changed: 16 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,7 @@ config](configuring_bolt.md) with the following values:
50
50
| --- | --- | --- |
51
51
|`cacert`|`String`| The path to the CA certificate for PuppetDB. |
52
52
|`connect_timeout`|`Integer`| How long to wait in seconds when establishing connections with PuppetDB. |
53
+
|`headers`|`Hash`| A map of HTTP headers to add to PuppetDB requests. |
53
54
|`read_timeout`|`Integer`| How long to wait in seconds for a response from PuppetDB. |
54
55
|`server_urls`|`Array`| An array of strings containing the PuppetDB host to connect to. Include the protocol `https` and the port, which is usually `8081`. For example, `https://my-puppetdb-server.example.com:8081`. The Bolt PuppetDB client attempts to connect to each host in the list until it makes a successful connection. |
55
56
@@ -94,6 +95,16 @@ puppetdb:
94
95
token: ~/.puppetlabs/token
95
96
```
96
97
98
+
To use custom headers, such as for OAuth authentication:
99
+
100
+
```
101
+
puppetdb:
102
+
server_urls: ["https://puppet.example.com:8081"]
103
+
cacert: /etc/puppetlabs/puppet/ssl/certs/ca.pem
104
+
headers:
105
+
Authorization: "Bearer <token-content>"
106
+
```
107
+
97
108
## Configuring multiple PuppetDB instances
98
109
99
110
The Bolt PuppetDB Client supports connections to multiple PuppetDB instances. To
@@ -244,15 +255,15 @@ plan puppetdb_query_targets {
244
255
# this returns an array of objects, each object containing a "certname" parameter:
0 commit comments