GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
ppdb(1) Hieracles command manual ppdb(1)

ppdb - Command line tool to query puppetdb

ppdb command [ options ]

This tool is part of the Hieracles tools suite.

PuppetDB stores information gathered by Puppet when nodes run the puppet client. It exposes a very neat REST interface, but its query system can be a little complicated.

The purpose of ppdb is to overlay the calls to the REST API and propose a more user-friendly way to query the Puppet Database (puppetdb).

Note that this tool is designed to work fine with the version 3 of the PuppetDB API.

Ref http://docs.puppetlabs.com/puppetdb/2.3/api/

ppdb takes a command, plus extra parameters depending the command.

node info <fqdn>
will display the equivalent of GET /v3/nodes/<NODE> and takes the node certname as an argument.
Optionaly, you can add a filter to limit what fields are displayed.
eg. ppdb node info <fqdn>
will display all the fields from the API response
eg. ppdb node info <fqdn> time
will only display the fields containing time in their label.

node facts <fqdn>
will display the equivalent of GET /v3/nodes/<NODE>/facts and takes the node certname as an argument.
As the result can be verbose, you can add a filter to limit what fields are displayed.
eg. ppdb node facts <fqdn>
will display all the fields from the API response
eg. ppdb node facts <fqdn> memory
will only display the fields containing memory in their label.

node resources <fqdn>
will display the equivalent of GET /v3/nodes/<NODE>/resources and takes the node certname as an argument. You can use res instead of resources for shorter.
As the result can be verbose, you can add a filter to limit what resources are displayed.
eg. ppdb node res <fqdn>
will display all the fields from the API response
eg. ppdb node res <fqdn> nagios
will only display the fields containing nagios in their label.

facts <name> <value>
will list all fqdn (aka. certnames) of the nodes having the <name> fact set to <value>.
eq. ppdb facts puppet_environment dev

same <name> <fqdn>
will list all the fqdn having the same value for the fact <name> as <fqdn> has.
eq. ppdb same farm node32.example.com

resources <queries>
res <queries>
will list the resources matching a given set of queries. Queries are a combination of statements, with a label, an operator and a value. You can use or to separate one or several statements. If there is no or indicated, the statements follow an and logic. All statements that don't contain an operator or match the or keyword are purely ignored (which makes possible to use the and keyword for mental stability purpose).

Operators can be >, <, =, ~ and can be prefixed by a ! to negate them.
eq. ppdb res type=Nagios_ghost and tag~api
eq. ppdb res tag~api title!~dev
eq. ppdb res tag~api or certname~api or title~api

factnames
will list all the factnames puppetdb knows about. This may be a long list.

-v
--version
outputs version.

-f format
--format format
outputs in the selected format. For now only the json format is available as an alternative to the default console format.

~/.config/hieracles/config.yaml
ppdb uses the same configuration file as hieracles, and relies on its information to find the url of the PuppetDB

A typical config file would contain, at minimum:

---
puppetdb:
usessl: false
host: localhost
port: 8080

hiera(1), puppet(8), hc(1)

Please report any bug to https://github.com/Gandi/hieracles/issues

Copyright (c) 2015 gandi.net https://gandi.net

Hieracles is written by mose@gandi.net

https://github.com/Gandi/hieracles

2015-12-05 version 0.2.1

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.