Professional Documents
Culture Documents
Node Collaboration With Puppetdb: Michael Richardson @M - Richo
Node Collaboration With Puppetdb: Michael Richardson @M - Richo
with PuppetDB
1. Who am i
2. The challenges we face
3. What is PuppetDB
4. How can PuppetDB help
5. Examples
$ whoami
• Michael Richardson @m_richo
• engineer at Odecee
• Solaris/Linux Sys Admin
• currently battling Windows
• coffee consumer
• devops enthusiast
• puppet certified
The Challenge
The Challenge
Faster
provisioning
The Challenge
more Faster
s ys t e ms provisioning
The Challenge
more Faster
s ys t e ms provisioning
more environments
dyn
env ami
iron c
me
nts
The Challenge
more Faster
s ys t e ms provisioning
more environments
dyn
env ami
iron c
g me
a lin nts
t o sc
a u
The Challenge
more Faster
s ys t e ms provisioning
more environments
micro-services dyn
env ami
iron c
g me
a lin nts
t o sc
a u
The Challenge
more Faster
s ys t e ms provisioning
more environments
micro-services dyn
env ami
iron c
g me
a lin nts
t o sc
a u
The Challenge
more Faster
s ys t e ms provisioning
more environments
Tools like Puppet have
become essential
The need for
automated, repeatable, versioned
provisioning and configuration
management of infrastructure and
services
Let’s raise the bar
We need
automated, repeatable, versioned
learning, reactive and adaptive
provisioning and configuration
management of infrastructure and
services
This is where
PuppetDB
and tools can help
So what is PuppetDB?
So what is PuppetDB?
1. PuppetLabs product.
2. Storage service for Puppet produced data.
3. Written in Clojure.
4. Persists data to a Postgres DB
5. Supports Puppet Enterprise and Puppet Open
Source environments.
PuppetDB
Puppet
Master PuppetDB Postgres
Puppet
Master PuppetDB Postgres
Node Facts
memo
rs i on
e tve
pupp operatingsystemrelease
t
arch
itect FQDN ce s s o r cou n
ure pro
Node Catalog’s
a t ion
s s i fi c
c la classes
Node Catalog’s
Relations
h ip
resources / depende
ncies
Facts about every node
Catalog for every node
CMDB??
So much useful data
How do we access it?
PuppetDB has an API
PuppetDB API
PuppetDB REST API has the following endpoints:
• Nodes • Environments
• Catalogs • Metrics
• Facts • Reports
• Fact-names • Events
• Resources • And more
Query PuppetDB
Query all the nodes
Query PuppetDB
Query nodes and filter results
Query PuppetDB
Query all facts for a given node
Query PuppetDB
Query an individual fact for a given node
Sick of running curl?
Check out Puppet Explorer
thank you Erik Dalén and
Check out Puppetboard
thank you Daniele Sluijters
Dashboards are lovely.
PuppetDBquery module
https://forge.puppetlabs.com/dalen/puppetdbquery
Hiera data
facts
catalog Puppet
agent Puppet code
report Master
Puppet run with
puppetdbquery
Hiera data
facts
catalog Puppet
agent Puppet code
report Master
PuppetDB
query_nodes
Accepts 2 arguments 1. Query to filter nodes
2. Fact to return (optional)
query fact
query_nodes
Accepts 2 arguments 1. Query to filter nodes
2. Fact to return (optional)
query fact
Returns an array of results
query facts
query_facts
Accepts 2 arguments
1. Query to filter nodes
2. List of facts to return
query facts
#protip
Go buy this book now
By Alessandro Franceschi
It is EXCELLENT!
Thank you.
Any Questions?