Book Image

Troubleshooting Puppet

By : Thomas Uphill
Book Image

Troubleshooting Puppet

By: Thomas Uphill

Overview of this book

Table of Contents (14 chapters)

PuppetDB


PuppetDB presents a REST API on port 8080. The API allows you to query for node information. Connecting to the REST API is a good way to verify that the service is running, and contains good data. By using the REST API, you can query for facts, nodes, or reports. When PuppetDB is operating correctly, a query to the /v3/nodes/ URL will return a list of nodes in the database, as shown in the following command:

[root@puppet ~]# curl 'http://localhost:8080/v3/nodes'
[ {
  "name" : "puppet.example.com",
  "deactivated" : null,
  "catalog_timestamp" : "2015-05-04T15:01:09.628Z",
  "facts_timestamp" : "2015-05-04T15:01:06.469Z",
  "report_timestamp" : null
} ]

The REST API will always be available if PuppetDB is running. The HTTP API is available on port 8080, and the HTTPS/SSL API is available on port 8081. If PuppetDB is configured to run on your master, then the 8080 interface will be used. However, if PuppetDB is configured on a separate server, then the 8081 interface will be used...