8 changes: 6 additions & 2 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,18 @@ https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/pupp

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash",
}
}
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"puppet.puppet-vscode",
"rebornix.Ruby"
]
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [],
Expand Down
1 change: 1 addition & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ fixtures:
apt: 'https://github.com/puppetlabs/puppetlabs-apt'
inifile: 'https://github.com/puppetlabs/puppetlabs-inifile'
grafana: 'https://github.com/voxpupuli/puppet-grafana'
influxdb: 'https://github.com/puppetlabs/influxdb'
archive: 'https://github.com/voxpupuli/puppet-archive'
systemd: 'https://github.com/voxpupuli/puppet-systemd'
yumrepo:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/main_pr_testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Call main PR testing workflows

on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**.md'
- 'examples/**'
- 'CODEOWNERS'
- 'LICENSE'

jobs:
spec_testing:
name: "Spec testing"
uses: ./.github/workflows/spec.yml

lts_testing:
name: "PE LTS Testing"
needs: spec_testing
uses: ./.github/workflows/pe_lts_testing.yml

latest_testing:
name: "PE latest Testing"
needs: spec_testing
uses: ./.github/workflows/pe_latest_testing.yml
2 changes: 1 addition & 1 deletion .github/workflows/pe_latest_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "PE Latest Acceptance Testing"

on:
workflow_dispatch:
pull_request:
workflow_call:

env:
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pe_lts_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "PE LTS Acceptance Testing"

on:
workflow_dispatch:
pull_request:
workflow_call:

env:
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Spec Tests"

on:
workflow_dispatch:
pull_request:
workflow_call:

env:
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
Expand Down
3 changes: 3 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ Rakefile:
spec/default_facts.yml:
extra_facts:
pe_build: '2021.5.0'
identity:
user: 'root'


Gemfile:
optional:
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [v1.2.0](https://github.com/puppetlabs/puppet_operational_dashboards/tree/temp-tag) (2022-06-10)

[Full Changelog](https://github.com/puppetlabs/puppet_operational_dashboards/compare/v1.1.0...temp-tag)

### Added

- \(SUP-3025\) Add spec tests [\#63](https://github.com/puppetlabs/puppet_operational_dashboards/pull/63) ([m0dular](https://github.com/m0dular))

### Fixed

- \(SUP-3358\) Fix $use\_ssl logic across all manifests [\#62](https://github.com/puppetlabs/puppet_operational_dashboards/pull/62) ([m0dular](https://github.com/m0dular))
- \(SUP-3357\) Move manage\_grafana to dashboard class [\#61](https://github.com/puppetlabs/puppet_operational_dashboards/pull/61) ([m0dular](https://github.com/m0dular))
- \(SUP-3348\) Telegraf ssl bugfixes [\#60](https://github.com/puppetlabs/puppet_operational_dashboards/pull/60) ([m0dular](https://github.com/m0dular))

## [v1.1.0](https://github.com/puppetlabs/puppet_operational_dashboards/tree/v1.1.0) (2022-05-27)

[Full Changelog](https://github.com/puppetlabs/puppet_operational_dashboards/compare/v1.0.0...v1.1.0)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ group :development do
gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby]
gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "voxpupuli-puppet-lint-plugins", '>= 3.0', require: false, platforms: [:ruby]
gem "voxpupuli-puppet-lint-plugins", '>= 3.0', require: false
gem "github_changelog_generator", require: false
gem "toml-rb", require: false
gem "octokit", '= 4.21.0', require: false
Expand Down
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
- [PuppetDB Performance](#puppetdb-performance)
- [PuppetDB Workload](#puppetdb-workload)
- [Postgres Metrics](#postgres-metrics)

- [Limitations](#limitations)
- [Troubleshooting](#troubleshooting)
## Description

This module is a replacement for the [puppet_metrics_dashboard module](https://forge.puppet.com/modules/puppetlabs/puppet_metrics_dashboard). It is used to configure Telegraf, InfluxDB, and Grafana to collect, store, and display metrics collected from Puppet services. By default, those components are installed on a separate Dashboard node by applying the base class of this module to that node. That class will automatically query PuppetDB for Puppet Infrastructure nodes (Primary server, Compilers, PuppetDB hosts, PostgreSQL hosts) or you can specify them via associated class parameters. It is not recommended to apply the base class of this module to one of your Puppet Infrastructure nodes.
Expand Down Expand Up @@ -232,6 +233,33 @@ Currently, only the latest Telegraf package is provided by the Ubuntu repository
## Upgrading from puppet_metrics_dashboard
This module uses InfluxDB 2.x, while `puppet_metrics_dashboard` uses 1.x. This module does not currently provide an option to upgrade between these versions, so it is recommended to either install this module on a new node or manually upgrade. See the [InfluxDB docs](https://docs.influxdata.com/influxdb/v2.2/upgrade/v1-to-v2/) for more information about upgrading.

## Applying classes on PE 2021.5 and 2021.6
On Puppet Enterprise versions 2021.5 and 2021.6, there is an issue when applying either the `puppet_operational_dashboards::enterprise_infrastructure` or `puppet_operational_dashboards::profile::postgres_access` classes in a user manifest. Doing so may result in an error such as:

```
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Comparison of: Undef Value < Integer, is not possible. Caused by 'Only Strings, Numbers, Timespans, Timestamps, and Versions are comparable'
```

This is due to an ordering issue with the `cert_allowlist_entry` defined type. The workaround is to apply the classes via the Console, for example by applying `puppet_operational_dashboards::enterprise_infrastructure` to the `PE Infrastructure Agent` node group. See [Installing on Puppet Enterprise](#installing-on-puppet-enterprise).

This issue only affect PE versions 2021.5 and 2021.6. Earlier versions are not affected, and later releases will include a fix to the defined type.

## Installing on openSUSE 15
On some versions of openSUSE 15, the `insserv-compat` package may be required to enable the Grafana service. If you see an error such as:

```
Error: /Stage[main]/Grafana::Service/Service[grafana]/ensure: change from 'stopped' to 'running' failed: Could not enable grafana-server:
```

This is due to the missing package:

```
Synchronizing state of grafana-server.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable grafana-server
/sbin/insserv: No such file or directory
```

Installing the `insserv-compat` resolves the error.
### Troubleshooting
If data is not displaying in Grafana or you see errors in Telegraf collections, try checking the following items.

Expand Down
28 changes: 17 additions & 11 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class {'puppet_operational_dashboards':
The following parameters are available in the `puppet_operational_dashboards` class:

* [`manage_influxdb`](#manage_influxdb)
* [`manage_grafana`](#manage_grafana)
* [`influxdb_host`](#influxdb_host)
* [`influxdb_port`](#influxdb_port)
* [`initial_org`](#initial_org)
Expand All @@ -66,14 +65,6 @@ Whether to manage installation and configuration of InfluxDB. Defaults to true

Default value: ``true``

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

Data type: `Boolean`

Whether to manage installation and configuration of Grafana. Defaults to true

Default value: ``true``

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

Data type: `String`
Expand Down Expand Up @@ -227,6 +218,7 @@ The following parameters are available in the `puppet_operational_dashboards::pr
* [`grafana_datasource`](#grafana_datasource)
* [`grafana_install`](#grafana_install)
* [`use_ssl`](#use_ssl)
* [`manage_grafana`](#manage_grafana)
* [`manage_grafana_repo`](#manage_grafana_repo)
* [`influxdb_host`](#influxdb_host)
* [`influxdb_port`](#influxdb_port)
Expand Down Expand Up @@ -305,6 +297,14 @@ Data type: `Boolean`

Whether to use SSL when querying InfluxDB. Defaults to true

Default value: `$puppet_operational_dashboards::use_ssl`

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

Data type: `Boolean`

Whether to manage installation and configuration of Grafana. Defaults to true

Default value: ``true``

##### <a name="manage_grafana_repo"></a>`manage_grafana_repo`
Expand Down Expand Up @@ -480,7 +480,7 @@ Data type: `Boolean`

Whether to use SSL when querying InfluxDB. Defaults to true

Default value: ``true``
Default value: `$puppet_operational_dashboards::use_ssl`

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

Expand Down Expand Up @@ -530,7 +530,6 @@ Data type: `Enum['all', 'local', 'none']`
Determines how metrics will be collected.
'all' will query all Puppet services across all Puppet infrastructure hosts from the node with this class applied.
'local' will query all Puppet services on the node with this class applied.
TODO
'none' will not query any services from the node with this class applied.

Default value: `'all'`
Expand Down Expand Up @@ -615,6 +614,7 @@ Defined type to create Telegraf configurations for a given service
The following parameters are available in the `puppet_operational_dashboards::telegraf::config` defined type:

* [`service`](#service)
* [`protocol`](#protocol)
* [`hosts`](#hosts)
* [`ensure`](#ensure)

Expand All @@ -626,6 +626,12 @@ Name of the service to query. Is the title of the resource.

Default value: `$title`

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

Data type: `Enum['https', 'http']`

Protocol to use in requests, either https or http

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

Data type: `Array[String[1]]`
Expand Down
11 changes: 1 addition & 10 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
# }
# @param manage_influxdb
# Whether to manage installation and configuration of InfluxDB. Defaults to true
# @param manage_grafana
# Whether to manage installation and configuration of Grafana. Defaults to true
# @param influxdb_host
# FQDN of the InfluxDB host. Defaults to a the value of influxdb::host, or $facts['fqdn'] if unset
# @param influxdb_port
Expand Down Expand Up @@ -37,7 +35,6 @@
# Telegraf token in Sensitive format.
class puppet_operational_dashboards (
Boolean $manage_influxdb = true,
Boolean $manage_grafana = true,
String $influxdb_host = lookup(influxdb::host, undef, undef, $facts['networking']['fqdn']),
Integer $influxdb_port = lookup(influxdb::port, undef, undef, 8086),
String $initial_org = lookup(influxdb::initial_org, undef, undef, 'puppetlabs'),
Expand All @@ -58,16 +55,11 @@
fail("Installation on ${facts['os']['family']} is not supported")
}

$protocol = $use_ssl ? {
true => 'https',
false => 'http',
}
$influxdb_uri = "${protocol}://${influxdb_host}:${influxdb_port}"

if $manage_influxdb {
class { 'influxdb':
host => $influxdb_host,
port => $influxdb_port,
use_ssl => $use_ssl,
initial_org => $initial_org,
token_file => $influxdb_token_file,
}
Expand All @@ -88,7 +80,6 @@

Influxdb_auth {
require => Class['influxdb'],
token_file => $influxdb_token_file,
}
}

Expand Down
Loading