• Stars
    star
    698
  • Rank 64,841 (Top 2 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 11 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Web frontend for PuppetDB

Puppetboard

PyPI Version PyPI Downloads Tests Status codecov By Voxpupuli

Puppetboard is a web interface to PuppetDB aiming to replace the reporting functionality of Puppet Enterprise console (previously: Puppet Dashboard) for the open source Puppet.

Overview

See more screenshots here.

Table of Contents

Requirements

  • PuppetDB v. 5.2-7.*
  • Python 3.8-3.11 or Docker

Installation

Puppetboard is packaged and available on PyPI.

With Puppet module

There is a Puppet module originally written by Spencer Krum and currently maintained by Voxpupuli that takes care of installing the Puppetboard for you.

To see how to get it working with RedHat/Centos 7 check out these docs.

Using Docker

We provide an official Docker image in the GitHub Container Registry.

You can run the app on your PuppetDB host with this command:

docker run -it \
  -e PUPPETDB_HOST=localhost \
  -e PUPPETDB_PORT=8080 \
  --net=host \
  ghcr.io/voxpupuli/puppetboard

Optionally you can set PUPPETBOARD_URL_PREFIX env variable to a value like /puppetboard to run the app under a URL prefix.

You can use the following Puppet Code to have Puppetboard managed by Puppet:

include docker

docker::image { 'ghcr.io/voxpupuli/puppetboard': }

docker::run { 'puppetboard':
  image => 'ghcr.io/voxpupuli/puppetboard',
  env   => [
    'PUPPETDB_HOST=127.0.0.1',
    'PUPPETDB_PORT=8080',
    'PUPPETBOARD_PORT=8088',
  ],
  net   => 'host',
}

We also provide the Dockerfile, so you can build the image yourself:

docker build -t puppetboard .

From a package

Actively maintained packages:

Manually

You can also install the package from PyPI and configure a WSGI-capable application server to serve it.

We recommend using virtualenv to provide a separate environment for the app.

virtualenv -p python3 venv
. venv/bin/activate
pip install puppetboard

Please see an article about more deployment setups here.

Configuration

Puppet agents

The default value of usecacheonfailure = true configuration setting for Puppet agents causes Puppet runs to always succeed, event if there are catalog compilation failures f.e. because of a syntax error in your code. This is because in such cases with this setting Puppet will just use a cached working catalog and report the run to PuppetDB as successful. (Although with an error visible in the Puppet run log.)

Therefore, to show the nodes with a catalog compilation as failed in Puppetboard you need to set usecacheonfailure = false in your nodes' puppet.conf.

PuppetDB

Of course you need to configure your Puppet Server to store the Puppet run reports in PuppetDB. If you haven't done that already please follow the PuppetDB documentation about this.

If you run Puppetboard on a different host than PuppetDB then you may want to configure the certificate allow-list for which certificates are allowed to access data from PuppetDB. Please read more about this feature in the PuppetDB documentation here.

App settings

Puppetboard will look for a file pointed at by the PUPPETBOARD_SETTINGS environment variable. The file has to be identical to default_settings.py but should only override the settings you need changed.

If you run PuppetDB and Puppetboard on the same machine the default settings provided will be enough to get you started and you won't need a custom settings file.

Assuming your webserver and PuppetDB machine are not identical you will at least have to change the following settings:

  • PUPPETDB_HOST
  • PUPPETDB_PORT

By default PuppetDB requires SSL to be used when a non-local client wants to connect. Therefore you'll also have to supply the following settings:

  • PUPPETDB_SSL_VERIFY = /path/to/ca/keyfile.pem
  • PUPPETDB_KEY = /path/to/private/keyfile.pem
  • PUPPETDB_CERT = /path/to/public/keyfile.crt

When using the Puppetboard Docker image, you may also pass Puppetboard it's certificate contents via these environment variables, either as a multiline string or pre-base64 encoded. This can be useful where the certificate is stored in a secrets store i.e. AWS SSM Parameter Store.

PUPPETDB_CERT="-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----"
PUPPETDB_CERT=LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQouLi4KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQ==

For information about how to generate the correct keys please refer to the pypuppetdb documentation. Alternatively it is possible to explicitly specify the protocol to be used setting the PUPPETDB_PROTO variable.

Other settings that might be interesting, in no particular order:

  • SECRET_KEY: set this to a long string, the same for each application replica and keep it secret. Refer to Flask documentation, section "How to generate good secret keys" for more info.
  • FAVORITE_ENVS: an ordered list of Puppet environment names that will be shown immediately after "All Environments" and before other environments (which are sorted by name) in the dropdown for choosing the environment shown in the top-right of the UI. Environments listed here that do not really exist in your deployment are silently ignored.
  • SHOW_ERROR_AS: friendly or raw. The former makes Puppet run errors in Report and Failures views shown in a modified, (arguably) more user-friendly form. The latter shows them as they are. Defaults to friendly.
  • CODE_PREFIX_TO_REMOVE: what code path that should be shortened in "Friendly errors" to "…" for readability. A regexp. Defaults to /etc/puppetlabs/code/environments(/.*?/modules)?.
  • PUPPETDB_TIMEOUT: Defaults to 20 seconds, but you might need to increase this value. It depends on how big the results are when querying PuppetDB. This behaviour will change in a future release when pagination will be introduced.
  • UNRESPONSIVE_HOURS: The amount of hours since the last check-in after which a node is considered unresponsive.
  • LOGLEVEL: A string representing the loglevel. It defaults to 'info' but can be changed to 'warning' or 'critical' for less verbose logging or 'debug' for more information.
  • ENABLE_QUERY: Defaults to True causing a Query tab to show up in the web interface allowing users to write and execute arbitrary queries against a set of endpoints in PuppetDB. Change this to False to disable this. See ENABLED_QUERY_ENDPOINTS to fine-tune which endpoints are allowed.
  • ENABLED_QUERY_ENDPOINTS: If ENABLE_QUERY is True, allow to fine tune the endpoints of PuppetDB APIs that can be queried. It must be a list of strings of PuppetDB endpoints for which the query is enabled. See the QUERY_ENDPOINTS constant in the puppetboard.app module for a list of the available endpoints.
  • GRAPH_TYPE: Specify the type of graph to display. Default is pie, other good option is donut. Other choices can be found here: _C3JS_documentation`
  • GRAPH_FACTS: A list of fact names to tell PuppetBoard to generate a pie-chart on the fact page. With some fact values being unique per node, like ipaddress, uuid, and serial number, as well as structured facts it was no longer feasible to generate a graph for everything.
  • INVENTORY_FACTS: A list of tuples that serve as the column header and the fact name to search for to create the inventory page. If a fact is not found for a node then undef is printed.
  • INVENTORY_FACT_TEMPLATES: A mapping between fact name and jinja template to customize display
  • ENABLE_CATALOG: If set to True allows the user to view a node's latest catalog. This includes all managed resources, their file-system locations and their relationships, if available. Defaults to False.
  • REFRESH_RATE: Defaults to 30 the number of seconds to wait until the index page is automatically refreshed.
  • DEFAULT_ENVIRONMENT: Defaults to 'production', as the name suggests, load all information filtered by this environment value.
  • REPORTS_COUNT: Defaults to 10 the limit of the number of reports to load on the node or any reports page.
  • OFFLINE_MODE: If set to True load static assets (jquery, semantic-ui, etc) from the local web server instead of a CDN. Defaults to False.
  • DAILY_REPORTS_CHART_ENABLED: Enable the use of daily chart graphs when looking at dashboard and node view.
  • DAILY_REPORTS_CHART_DAYS: Number of days to show history for on the daily report graphs.
  • DISPLAYED_METRICS: Metrics to show when displaying node summary. Example: 'resources.total', 'events.noop'.
  • TABLE_COUNT_SELECTOR: Configure the dropdown to limit number of hosts to show per page.
  • LITTLE_TABLE_COUNT: Default number of reports to show when when looking at a node.
  • NORMAL_TABLE_COUNT: Default number of nodes to show when displaying reports and catalog nodes.
  • LOCALISE_TIMESTAMP: If set to True then timestamps are shown using your browser's timezone. Otherwise UTC is used. Defaults to True.
  • WITH_EVENT_NUMBERS: If set to True then Overview and Nodes list shows exact number of changed resources in the last report. Otherwise shows only 'some' string if there are resources with given status. Setting this to False gives performance benefits, especially in big Puppet environments (more than few hundreds of nodes). Defaults to True.
  • ENABLE_CLASS: If set to True allows the user to view the number of resource events (number of changed resources in the last report) grouped by class. The resource events are grouped by their status ('failure', 'success', 'noop').
  • CLASS_EVENTS_STATUS_COLUMNS: A mapping between the status of the resource events and the name of the columns of the table to display.
  • CACHE_TYPE: Specifies which type of caching object to use when SCHEDULER_ENABLED is set to True. The cache is used for the classes view (ENABLE_CLASS is set to True) which requires parsing the events of all the latest reports to group them by Puppet class. If the last report is present in the cache, we do not parse the events, which avoids unnecessary processing. If you configure more than one worker, you must use a shared backend (e.g. MemcachedCache) to allow the sharing of the cache between the processes. Indeed, the SimpleCache type does not allow sharing the cache between processes, it uses the process memory to store the cache. Defaults to SimpleCache.
  • CACHE_DEFAULT_TIMEOUT: Cache lifetime in second. Defaults to 3600.
  • SCHEDULER_ENABLED: If set to True then a scheduler instance is created in order to execute scheduled jobs. Defaults to False.
  • SCHEDULER_JOBS: List of the scheduled jobs to trigger within a worker. A job can for example be used to compute a result to be cached. This is the case for the classes view which uses a job to pre-compute at regular intervals the results to be displayed. Each scheduled job must contain the following fields: id, func, trigger, seconds.
  • SCHEDULER_LOCK_BIND_PORT: Specifies an available port that allows a single worker to listen on it. This allows to configure scheduled jobs in a single worker. Defaults to 49100.

Getting Help

For questions or bug reports you can file an issue.

Contributing

Development

Puppetboard relies on the pypuppetdb library to fetch data from PuppetDB and is built with the help of the Flask microframework.

If you wish to hack on Puppetboard you should fork/clone the Github repository and then install the requirements through:

pip install --upgrade wheel setuptools
python setup.py develop
pip install --upgrade -r requirements-test.txt
mypy --install-types --non-interactive puppetboard/ test/

You're advised to do this inside a virtualenv specifically created to work on Puppetboard as to not pollute your global Python installation.

You can run the tests with:

pytest --cov=. --cov-report=xml --strict-markers --mypy puppetboard test
pylint --errors-only puppetboard test

You can run the app it in development mode by simply executing:

flask run

You can specify listening host and port with environment variables or command line otions:

export FLASK_RUN_HOST=0.0.0.0
export FLASK_RUN_PORT=8000

flask run

or

flask run --host '0.0.0.0' --port '8000'

Use PUPPETBOARD_SETTINGS to change the different settings or patch default_settings.py directly. Take care not to include your local changes on that file when submitting patches for Puppetboard. Place a settings.py file inside the base directory of the git repository that will be used, if the environment variable is not set.

We welcome contributions to this project. However, there are a few ground rules contributors should be aware of.

License

This project is licensed under the Apache v2.0 License. As such, your contributions, once accepted, are automatically covered by this license.

Commit messages

Write decent commit messages. Don't use swear words and refrain from uninformative commit messages as 'fixed typo'.

The preferred format of a commit message:

docs/quickstart: Fixed a typo in the Nodes section.

If needed, elaborate further on this commit. Feel free to write a
complete blog post here if that helps us understand what this is
all about.

Fixes #4 and resolves #2.

If you'd like a more elaborate guide on how to write and format your commit messages have a look at this post by Tim Pope.

More Screenshots

  • Overview / Index / Homepage

Overview / Index / Homepage

  • Nodes view, all active nodes

Nodes view, all active nodes

  • Single node page / overview

Single node page / overview

  • Report view

Report view

  • Facts view

Facts view

  • Single fact, with graphs

Single fact, with graphs

  • All nodes that have this fact with that value

All nodes that have this fact with that value

  • Query view - results as table

Query view

  • Query view - results as JSON

Query view

  • Metrics view

Metrics view

  • Single metric

Single metric

  • Inventory view

Inventory view

  • Classes view, group the resource events of the last reports by Puppet class

Classes view

  • Class view, list the nodes with almost one resource event for a given class

Class view

Legal

The app code is licensed under the Apache License, Version 2.0.

The favicon has been created based on the icon created by Jonathan Coutiño under the Attribution 3.0 Unported (CC BY 3.0) license, downloaded from the Noun Project.

More Repositories

1

json-schema

Ruby JSON Schema Validator
Ruby
1,447
star
2

hiera-eyaml

A backend for Hiera that provides per-value asymmetric encryption of sensitive data
Ruby
528
star
3

puppet-nginx

Puppet Module to manage NGINX on various UNIXes
Ruby
468
star
4

puppet-elasticsearch

Elasticsearch Puppet module
Ruby
406
star
5

beaker

Puppet Acceptance Testing Harness
Ruby
368
star
6

puppet-jenkins

Puppet module for Jenkins
Ruby
276
star
7

puppet-python

Puppet module for installing and managing Python, pip, virtualenvs and Gunicorn virtual hosts.
Ruby
197
star
8

puppet-logstash

Puppet module to manage Logstash
Puppet
192
star
9

puppet-rabbitmq

RabbitMQ Puppet Module
Ruby
174
star
10

onceover

Your gateway drug to automated infrastructure testing with Puppet
Ruby
142
star
11

puppet-mcollective

MCollective Server and Client Puppet Module
Ruby
122
star
12

puppet-consul

A Puppet Module to Manage Consul
Ruby
120
star
13

puppet-openvpn

OpenVPN module for puppet including client config/cert creation
Ruby
113
star
14

puppet-nodejs

Puppet module to install nodejs and global npm packages
Ruby
112
star
15

modulesync

Synchronize common files across your Git repositories.
Ruby
101
star
16

vagrant-librarian-puppet

A Vagrant plugin to install Puppet modules using Librarian-Puppet.
Ruby
101
star
17

puppet-r10k

Setup and configure r10k for use with git based environments in puppet
Ruby
98
star
18

pypuppetdb

Python library for working with the PuppetDB API
Python
93
star
19

puppet-mongodb

mongodb installation
Ruby
92
star
20

puppet-ghostbuster

👻 Dead code detector for Puppet
Ruby
89
star
21

puppet-letsencrypt

A Puppet module to install the Letsencrypt client and request certificates.
Ruby
86
star
22

puppet-php

Generic Puppet module to manage PHP on many platforms
Puppet
85
star
23

puppet-mode

Edit Puppet manifests with GNU Emacs 24
Emacs Lisp
77
star
24

puppet-gitlab

Puppet module to manage Gitlab (Omnibus)
Puppet
74
star
25

puppet-postfix

Puppet postfix module
HTML
72
star
26

puppet-collectd

Collectd module for Puppet
Ruby
70
star
27

puppet-syntax

Syntax checks for Puppet manifests and templates
Ruby
68
star
28

puppet-blacksmith

Ruby Gem with Puppet Module utilities
Ruby
68
star
29

puppet-network

Types and providers to manage network interfaces
Ruby
68
star
30

puppet-augeasproviders

Alternative Augeas-based providers for Puppet
Ruby
65
star
31

puppet-system

Manage Linux system resources and services from hiera configuration
Puppet
64
star
32

puppet-jira

Atlassian JIRA Puppet Module
Ruby
61
star
33

puppet-prometheus

Puppet module for prometheus
Puppet
60
star
34

puppet-archive

Compressed archive file download and extraction with native types/providers for Windows and Unix
Ruby
59
star
35

beaker-rspec

beaker-rspec is a bridge between the puppet acceptance test harness
Ruby
58
star
36

rspec-puppet-facts

Simplify your unit tests by looping on every supported Operating System and populating facts.
Ruby
58
star
37

puppet-puppetboard

Puppet module to install and manage puppetboard
Puppet
53
star
38

puppet-staging

⛔️ Deprecated in favor of puppet-archive
Ruby
51
star
39

puppet-pxe

Puppet module for deploying a PXE boot server
Puppet
49
star
40

hiera-eyaml-gpg

GPG encryption backend for the hiera-eyaml module
Ruby
49
star
41

puppet-systemd

Puppet module to manage systemd
Ruby
49
star
42

puppet-selinux

Puppet Module to manage SELinux on RHEL machines
Ruby
49
star
43

puppet-keepalived

Puppet Module to manage Keepalived
Ruby
48
star
44

puppet-prometheus_reporter

A prometheus Puppet reports exporter for Puppet
Ruby
48
star
45

puppet-iis

Module to mange IIS with Puppet
Ruby
46
star
46

puppet-corosync

Sets up and manages Corosync.
Ruby
45
star
47

puppet-dhcp

Puppet module for deploying dhcp
Ruby
42
star
48

puppet-epel

Setup/configure EPEL (extra repository for enterprise linux) with Puppet
Ruby
41
star
49

puppet-redis

Puppet Module to manage Redis
Ruby
40
star
50

puppet-openssl

Puppet OpenSSL module
Ruby
39
star
51

puppet-pkgng

A Puppet package provider for FreeBSD's PkgNG package manager.
Ruby
39
star
52

puppet-firewalld

Puppet module for managing firewalld
Ruby
39
star
53

puppet-splunk

Manage Splunk servers and forwarders using Puppet
Ruby
39
star
54

puppet-rundeck

Module for managing the installatation and configuration of the rundeck orchestration tool
Ruby
38
star
55

puppet-openldap

Manage OpenLDAP with Puppet
Ruby
35
star
56

puppet-vmwaretools

Puppet module to manage VMware Operating System Specific Packages for VMware tools installation.
Puppet
35
star
57

puppet-snmp

Puppet module to manage Net-SNMP.
Ruby
34
star
58

puppet-unattended_upgrades

Unattended-upgrades for APT
Ruby
33
star
59

puppet-dnsquery

DNS query functions for Puppet
Ruby
32
star
60

puppet-hiera

Hiera hierarchy module for templating `hiera.yaml`
Ruby
32
star
61

puppet-kafka

The kafka module for managing the installation and configuration of Apache Kafka
Puppet
30
star
62

puppet-fail2ban

This module installs, configures and manages the Fail2ban service.
Ruby
30
star
63

ra10ke

Rake tasks related to R10K and Puppetfile
Ruby
29
star
64

puppet-wildfly

Puppet module to install, configure and manage Wildfly (8/9/10+), JBoss EAP (6.1+/7.0+) and some Wildfly based products like apiman, Keycloak and Infinispan.
Ruby
29
star
65

puppet-windowsfeature

Library that uses ServerAdministration api that comes with Windows Server 2008 and Windows Server 2012 to add / remove windows features
Ruby
29
star
66

puppet-catalog-diff-viewer

A viewer for the puppet-catalog-diff tool
JavaScript
28
star
67

puppet-unbound

Puppet module for deploying the swiss-army of DNS, Unbound
Ruby
28
star
68

metadata-json-lint

Tool to check the validity of Puppet metadata.json files
Ruby
27
star
69

hiera-file

File backend for Hiera
Ruby
26
star
70

puppet-vault_lookup

Ruby
25
star
71

puppetdb-ruby

Ruby client library for interacting with PuppetDB API
Ruby
24
star
72

puppet-alternatives

Manage Debian alternatives links
Ruby
24
star
73

puppet-telegraf

A Puppet module for installing and configuring InfluxData's Telegraf
Ruby
24
star
74

puppet-healthcheck

Puppet resources to evaluate the health and status of things.
Ruby
22
star
75

puppet-puppetserver

Puppet module for puppetserver
Ruby
21
star
76

puppet-confluence

A puppet module to install confluence
Ruby
20
star
77

puppet-drbd

Basic module for configuring active-passive drbd resources
Puppet
20
star
78

puppet-stash

A puppet module to install atlassian stash
Ruby
19
star
79

puppet-kmod

manage kernel module with puppet
Ruby
18
star
80

puppet-mrepo

Puppet module for creating and managing RPM based repository mirrors.
Puppet
17
star
81

puppet-ssh_keygen

Generation of ssh keys with ssh-keygen
Ruby
17
star
82

puppet-windows_firewall

puppet module for configuring the windows firewall
Ruby
17
star
83

puppet-nomad

Puppet module for managing Nomad
Ruby
16
star
84

puppet-gluster

Create and manage Gluster pools, volumes, and mounts
Ruby
16
star
85

puppet-kibana

Kibana Puppet module by Elastic.
Ruby
16
star
86

puppet-filemapper

Map files to puppet resources and back
Ruby
15
star
87

puppet-proxysql

Puppet module to configure ProxySQL
Ruby
15
star
88

puppet-cron

Puppet module to manage cron jobs via /etc/cron.d
Ruby
14
star
89

puppet-tea

Puppet 4.6 Types: Abstracted & Extracted
Ruby
14
star
90

puppet-ca_cert

A puppet module for managing (non-system) CA certificates.
Ruby
14
star
91

puppet-minecraft

Puppet - Minecraft: Separately maintained fork of brannan's puppet-module-minecraft
Ruby
14
star
92

puppet-chrony

Puppet module for Chrony with Systemd
Ruby
13
star
93

puppet-smokeping

Puppet module to install and configure smokeping. Including target and slave definition
Puppet
13
star
94

puppet-cassandra

Installs Cassandra & DataStax Agent on RHEL/Ubuntu/Debian.
Ruby
13
star
95

puppet-googleauthenticator

Google-authenticator module for Puppet
Puppet
13
star
96

puppet-bareos

Puppet Module to manage bareos
Puppet
13
star
97

puppet-misp

This module installs and configures MISP (Malware Information Sharing Platform)
HTML
13
star
98

puppet_webhook

Sinatra-based application that triggers puppet-related commands from VCS Webhook calls
Ruby
13
star
99

puppet-extlib

This module provides functions that are out of scope for stdlib.
Ruby
13
star
100

puppet-gitlab_ci_runner

Module to mange gitlab CI runners. Extracted from https://github.com/voxpupuli/puppet-gitlab
Ruby
13
star