Last active
March 15, 2016 20:32
-
-
Save natemccurdy/df8a2ca00f3783e7931e to your computer and use it in GitHub Desktop.
Search for list of classes in puppetserver API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# GIST_URL: https://gist.github.com/natemccurdy/df8a2ca00f3783e7931e | |
# This script searches the puppetserver API for all known classes that match ^pe_.* | |
# Adjust the search pattern to tailor this script to your particular search pattern. | |
# Set variables for the curl. | |
CERT="/etc/puppetlabs/puppet/ssl/certs/pe-internal-classifier.pem" | |
KEY="/etc/puppetlabs/puppet/ssl/private_keys/pe-internal-classifier.pem" | |
CACERT="/etc/puppetlabs/puppet/ssl/certs/ca.pem" | |
/opt/puppetlabs/puppet/bin/curl -s -X GET \ | |
--header "Content-Type: application/json" \ | |
--cert "$CERT" \ | |
--key "$KEY" \ | |
--cacert "$CACERT" \ | |
"https://$(hostname -f):8140/puppet/v3/resource_types/^pe_.*?environment=production&kind=class" | python -m json.tool | grep \"name\" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment