Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add graph_facts variable to enable graphing (pie/bar) of Puppet facts #377

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ The following parameters are available in the `puppetboard` class:
* [`ldap_require_group`](#ldap_require_group)
* [`apache_confd`](#apache_confd)
* [`apache_service`](#apache_service)
* [`graph_facts'](#graph_facts)

##### <a name="install_from"></a>`install_from`

Expand Down Expand Up @@ -414,6 +415,12 @@ Data type: `String[1]`

name of the apache2 service

##### <a name="graph_facts"></a>`graph_facts`

Data type: `Optional[Variant[String[1], Array[String[1]]]]`

An array of the puppet facts to graph. See ''https://github.com/voxpupuli/puppetboard''

### <a name="puppetboardapacheconf"></a>`puppetboard::apache::conf`

Creates an entry in your apache configuration directory to run PuppetBoard server-wide (i.e. not in a vhost).
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# @param homedir Puppetboard system user's home directory.
# @param group Puppetboard system group.
# @param groups additional groups for the user that runs puppetboard
# @param graph_facts Array of puppet facts to graph (pie/bar chart).
# @param basedir Base directory where to build puppetboard vcsrepo and python virtualenv.
# @param git_source Location of upstream Puppetboard GIT repository
# @param puppetdb_host PuppetDB Host
Expand Down Expand Up @@ -67,6 +68,7 @@
Optional[Stdlib::Absolutepath] $homedir = undef,
String $group = 'puppetboard',
Optional[Variant[String[1], Array[String[1]]]] $groups = undef,
Optional[Variant[String[1], Array[String[1]]]] $graph_facts = undef,
Stdlib::AbsolutePath $basedir = '/srv/puppetboard',
String $git_source = 'https://github.com/voxpupuli/puppetboard',
String $dev_listen_host = '127.0.0.1',
Expand Down
3 changes: 3 additions & 0 deletions templates/settings.py.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ DEFAULT_ENVIRONMENT = '<%= @default_environment %>'
<% if @reports_count -%>
REPORTS_COUNT = <%= @reports_count %>
<% end -%>
<% if @graph_facts -%>
GRAPH_FACTS = '<%= @graph_facts.sort.uniq.join(',') %>'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a unit test for the change with a string as input and one with an array. We need to ensure the sort.uniq.join construct works with strings as well.

<% end -%>
<% @extra_settings.keys.sort.each do |key| -%>
<%= key %> = <%= @extra_settings[key] %>
<% end -%>