Skip to content

DEPRECATED - Grep for facter fact on all nodes matching your puppetdb query

Notifications You must be signed in to change notification settings

jhaals/puppetdb-grep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

puppetdb-grep

puppetdb-grep gives you the ability to for example get all puppetversions for active nodes running Linux.

This is just a quick evening hack I did, don't expect any magic unicorns!

Please note that some queries are expensive since puppetdb-grep asks all nodes matching your query for their --grep fact

Examples:

Give me all active nodes:

puppetdb-grep.py --query '["=", ["node", "active"], True]'

Give me all active nodes and their puppetversion

puppetdb-grep.py --query '["=", ["node", "active"], True]' --grep puppetversion

Query active nodes with kernel Linux with uptime greater then 30, grep for their memorytotal

puppetdb-grep.py --query '["and",
    ["=", ["node", "active"], True],
    ["=", ["fact", "kernel"], "Linux"],
    [">", ["fact", "uptime_days"], 30]]' --grep memorytotal

Example Output:

$ puppetdb-grep.py --query '
    ["and",["=", ["node", "active"], True],
    ["=", ["fact", "Linux"], "Darwin"],
    [">", ["fact", "uptime_days"], 30]]' --grep puppetversion
2.7.18:
- node1.example.com
- node.32.example.com
2.7.19:
- node139.example.com
- node75.example.com

About

DEPRECATED - Grep for facter fact on all nodes matching your puppetdb query

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages