puppetboard: Adding Catalog Viewer
This makes use of the available catalog endpoints in pypuppetdb and PuppetDB and displays to administrators the last compiled catalog for a node, if the variable ENABLE_CATALOG is True (defaults to False)
This commit is contained in:
@@ -403,3 +403,13 @@ def metric(metric):
|
||||
'metric.html',
|
||||
name=name,
|
||||
metric=sorted(metric.items()))
|
||||
|
||||
@app.route('/catalog/<node_name>')
|
||||
def catalog_node(node_name):
|
||||
"""Fetches from PuppetDB the compiled catalog of a given node."""
|
||||
if app.config['ENABLE_CATALOG']:
|
||||
catalog = puppetdb.catalog(node=node_name)
|
||||
return render_template('catalog.html', catalog=catalog)
|
||||
else:
|
||||
log.warn('Access to catalog interface disabled by administrator')
|
||||
abort(403)
|
||||
|
||||
Reference in New Issue
Block a user