Last active
April 24, 2016 12:52
-
-
Save blackknight36/b906ca1503d31f28b2709f91d8fcc8fa to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/python | |
from pypuppetdb import connect | |
import platform | |
hostname = platform.node() | |
cert = '/etc/puppetlabs/puppet/ssl/certs/%s.pem' %hostname | |
key = '/etc/puppetlabs/puppet/ssl/private_keys/%s.pem' %hostname | |
ca_cert = '/etc/puppetlabs/puppet/ssl/ca/ca_crt.pem' | |
puppetdb_host = 'puppetdb.example.com' | |
db = connect(host=puppetdb_host, port=8081, ssl_key=key, ssl_cert=cert, ssl_verify=ca_cert) | |
nodes = db.nodes() | |
for node in nodes: | |
print(node) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment