Skip to content
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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

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).

## [v2.4.0](https://github.com/puppetlabs/puppet_operational_dashboards/tree/v2.3.0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

the changelog is generated automatically, please don't do it by hand

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is when the release workflow works, which it currently doesn't. I thought I'd have to manually do it at the moment?


[Full Changelog](https://github.com/puppetlabs/puppet_operational_dashboards/compare/v2.3.0...v2.4.0)

### Added

- Add new management params
- Add support for InfluxDB 1 in Telegraf outputs
- Make file-sync metrics configurable
- Add parameter for extra options to Telegraf inputs

## [v2.3.0](https://github.com/puppetlabs/puppet_operational_dashboards/tree/v2.3.0) (2024-02-05)

[Full Changelog](https://github.com/puppetlabs/puppet_operational_dashboards/compare/v2.2.0...v2.3.0)
Expand Down
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [Beginning with puppet_operational_dashboards](#beginning-with-puppet_operational_dashboards)
- [Installing on Puppet Enterprise](#installing-on-puppet-enterprise)
- [Installing on Puppet Open Source](#installing-on-puppet-open-source)
- [Advanced Telegraf Configuration](#advanced-telegraf-configuration)
- [What puppet_operational_dashboards affects](#what-puppet_operational_dashboards-affects)
- [Usage](#usage)
- [Evaluation order](#evaluation-order)
Expand Down Expand Up @@ -221,6 +222,72 @@ The easiest way to get started using this module is by including the `puppet_ope
include puppet_operational_dashboards
```

#### Advanced Telegraf Configuration

If you already have an existing setup and defined configuration for Telegraf and InfluxDB, it is possible to only configure the Telegraf inputs needed for collection of Puppet metrics via the `puppet_operational_dashboards::telegraf::agent` class. The main use case for this is if you already manage Telegraf and InfluxDB in Puppet code, and you only want to use this module to collect and ship Puppet metrics to your existing InfluxDB. To do so, you may apply the `puppet_operational_dashboards::telegraf::agent` class to either:

* Each Puppet infrastructure node to collect metrics locally
* A single node to remotely collect metrics from all infrastructure nodes

For the first case of local collection, set `collection_method: 'local'` and `local_services` to an array of Puppet services to collect from, for example `local_services: ['puppetserver', 'puppetdb']`.

For the second case of remote collection, use `collection_method: 'all'` and set each of the following as needed:

* puppetserver_hosts
* orchestrator_hosts
* puppetdb_hosts
* postgres_hosts

In either case, you can control whether this class will manage the Telegraf class and service with:

```yaml
puppet_operational_dashboards::telegraf::agent::manage_class
```

Whether to manage Telegraf outputs with:

```yaml
puppet_operational_dashboards::telegraf::agent::manage_outputs
```

And whether to configure token authentication in the inputs with:
```yaml
puppet_operational_dashboards::telegraf::agent::use_token_auth
```

You may also pass additional options to the Telegraf inputs, for example, if you need to add a tag. The following hiera data will add an additional `[inputs.http.tags]` element with a key/value pair of `foo = bar`:

```yaml
puppet_operational_dashboards::telegraf::agent::extra_input_options:
tags:
foo: 'bar'
```

The following is a complete example to configure a Telegraf input for collecting Puppet server metrics locally with an additional tag:

```yaml
puppet_operational_dashboards::telegraf::agent::local_services:
- 'puppetserver'
puppet_operational_dashboards::telegraf::agent::token_name: 'puppetlabs'
puppet_operational_dashboards::telegraf::agent::influxdb_token_file: '/root/.influxdb_token'
puppet_operational_dashboards::telegraf::agent::influxdb_bucket: 'puppet_data'
puppet_operational_dashboards::telegraf::agent::influxdb_org: 'puppetlabs'
puppet_operational_dashboards::telegraf::agent::include_pe_metrics: false
puppet_operational_dashboards::telegraf::agent::manage_repo: false
puppet_operational_dashboards::telegraf::agent::manage_class: false
puppet_operational_dashboards::telegraf::agent::influxdb_host: 'foo.bar.com'
puppet_operational_dashboards::telegraf::agent::influxdb_port: 8086
puppet_operational_dashboards::telegraf::agent::use_token_auth: false
puppet_operational_dashboards::telegraf::agent::manage_outputs: false
puppet_operational_dashboards::telegraf::agent::collection_method: 'local'
puppet_operational_dashboards::telegraf::agent::use_ssl: true
puppet_operational_dashboards::telegraf::agent::use_system_store: false
puppet_operational_dashboards::telegraf::agent::template_format: 'yaml'
puppet_operational_dashboards::telegraf::agent::extra_input_options:
tags:
foo: 'bar'
```

#### What puppet_operational_dashboards affects
Installing the module will:

Expand Down
59 changes: 58 additions & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,11 @@ The following parameters are available in the `puppet_operational_dashboards::te
* [`use_system_store`](#-puppet_operational_dashboards--telegraf--agent--use_system_store)
* [`manage_ssl`](#-puppet_operational_dashboards--telegraf--agent--manage_ssl)
* [`manage_repo`](#-puppet_operational_dashboards--telegraf--agent--manage_repo)
* [`manage_class`](#-puppet_operational_dashboards--telegraf--agent--manage_class)
* [`use_token_auth`](#-puppet_operational_dashboards--telegraf--agent--use_token_auth)
* [`manage_archive`](#-puppet_operational_dashboards--telegraf--agent--manage_archive)
* [`manage_user`](#-puppet_operational_dashboards--telegraf--agent--manage_user)
* [`manage_outputs`](#-puppet_operational_dashboards--telegraf--agent--manage_outputs)
* [`ssl_cert_file`](#-puppet_operational_dashboards--telegraf--agent--ssl_cert_file)
* [`ssl_key_file`](#-puppet_operational_dashboards--telegraf--agent--ssl_key_file)
* [`ssl_ca_file`](#-puppet_operational_dashboards--telegraf--agent--ssl_ca_file)
Expand All @@ -630,6 +633,7 @@ The following parameters are available in the `puppet_operational_dashboards::te
* [`puppet_ssl_ca_file`](#-puppet_operational_dashboards--telegraf--agent--puppet_ssl_ca_file)
* [`insecure_skip_verify`](#-puppet_operational_dashboards--telegraf--agent--insecure_skip_verify)
* [`version`](#-puppet_operational_dashboards--telegraf--agent--version)
* [`influxdb_version`](#-puppet_operational_dashboards--telegraf--agent--influxdb_version)
* [`archive_location`](#-puppet_operational_dashboards--telegraf--agent--archive_location)
* [`archive_install_dir`](#-puppet_operational_dashboards--telegraf--agent--archive_install_dir)
* [`collection_method`](#-puppet_operational_dashboards--telegraf--agent--collection_method)
Expand All @@ -648,6 +652,7 @@ The following parameters are available in the `puppet_operational_dashboards::te
* [`telegraf_postgres_password`](#-puppet_operational_dashboards--telegraf--agent--telegraf_postgres_password)
* [`postgres_port`](#-puppet_operational_dashboards--telegraf--agent--postgres_port)
* [`postgres_options`](#-puppet_operational_dashboards--telegraf--agent--postgres_options)
* [`extra_input_options`](#-puppet_operational_dashboards--telegraf--agent--extra_input_options)
* [`template_format`](#-puppet_operational_dashboards--telegraf--agent--template_format)

##### <a name="-puppet_operational_dashboards--telegraf--agent--token"></a>`token`
Expand Down Expand Up @@ -720,6 +725,18 @@ Data type: `Boolean`

Whether to install Telegraf from a repository.

##### <a name="-puppet_operational_dashboards--telegraf--agent--manage_class"></a>`manage_class`

Data type: `Boolean`

Whether to manage the Telegraf class and related resources

##### <a name="-puppet_operational_dashboards--telegraf--agent--use_token_auth"></a>`use_token_auth`

Data type: `Boolean`

Whether to set up and use token based auth to InfluxDB

##### <a name="-puppet_operational_dashboards--telegraf--agent--manage_archive"></a>`manage_archive`

Data type: `Boolean`
Expand All @@ -736,6 +753,14 @@ Whether to manage the telegraf user when installing from archive.

Default value: `true`

##### <a name="-puppet_operational_dashboards--telegraf--agent--manage_outputs"></a>`manage_outputs`

Data type: `Boolean`

Whether to manage the telegraf outputs

Default value: `true`

##### <a name="-puppet_operational_dashboards--telegraf--agent--ssl_cert_file"></a>`ssl_cert_file`

Data type: `Stdlib::Absolutepath`
Expand Down Expand Up @@ -798,6 +823,14 @@ Data type: `String`

Version of the Telegraf package to install.

##### <a name="-puppet_operational_dashboards--telegraf--agent--influxdb_version"></a>`influxdb_version`

Data type: `Enum['v1', 'v2']`

Which version of InfluxDB to use in the inputs. Currently supports versions 1 and 2

Default value: `'v2'`

##### <a name="-puppet_operational_dashboards--telegraf--agent--archive_location"></a>`archive_location`

Data type: `String`
Expand Down Expand Up @@ -956,6 +989,14 @@ Default value:
}
```

##### <a name="-puppet_operational_dashboards--telegraf--agent--extra_input_options"></a>`extra_input_options`

Data type: `Optional[Hash]`

Optional hash of extra values to pass to each telegraf::input declared in this module

Default value: `undef`

##### <a name="-puppet_operational_dashboards--telegraf--agent--template_format"></a>`template_format`

Data type: `Enum['yaml','toml']`
Expand All @@ -980,6 +1021,8 @@ The following parameters are available in the `puppet_operational_dashboards::te
* [`ensure`](#-puppet_operational_dashboards--telegraf--config--ensure)
* [`http_timeout_seconds`](#-puppet_operational_dashboards--telegraf--config--http_timeout_seconds)
* [`template_format`](#-puppet_operational_dashboards--telegraf--config--template_format)
* [`include_pe_metrics`](#-puppet_operational_dashboards--telegraf--config--include_pe_metrics)
* [`extra_input_options`](#-puppet_operational_dashboards--telegraf--config--extra_input_options)

##### <a name="-puppet_operational_dashboards--telegraf--config--service"></a>`service`

Expand Down Expand Up @@ -1023,6 +1066,20 @@ Template format to use for puppet template toml or yaml config

Default value: `'toml'`

##### <a name="-puppet_operational_dashboards--telegraf--config--include_pe_metrics"></a>`include_pe_metrics`

Data type: `Boolean`

Whether to include Filesync metrics in Puppetserver

##### <a name="-puppet_operational_dashboards--telegraf--config--extra_input_options"></a>`extra_input_options`

Data type: `Optional[Hash]`

Optional hash of extra values to pass to each telegraf::input declared in this module

Default value: `undef`

## Functions

### <a name="puppet_operational_dashboards--hosts_with_profile"></a>`puppet_operational_dashboards::hosts_with_profile`
Expand Down Expand Up @@ -1194,7 +1251,7 @@ Default value:
```puppet
[{
'type' => 'expire',
'everySeconds' => 3456000,
'everySeconds' => 7776000,
'shardGroupDurationSeconds' => 604800,
}]
```
Expand Down
2 changes: 2 additions & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
---
puppet_operational_dashboards::telegraf::agent::manage_repo: false
puppet_operational_dashboards::telegraf::agent::manage_class: true
puppet_operational_dashboards::telegraf::agent::use_token_auth: true
puppet_operational_dashboards::telegraf::agent::version: '1.29.4-1'
7 changes: 6 additions & 1 deletion functions/pe_profiles_on_host.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ function puppet_operational_dashboards::pe_profiles_on_host() >> Array[String] {
$hosts = puppetdb_query("resources[title] {
type = 'Class' and
certname = '${trusted['certname']}' and
title in ['Puppet_enterprise::Profile::Puppetdb', 'Puppet_enterprise::Profile::Master', 'Puppet_enterprise::Profile::Database', 'Puppet_enterprise::Profile::Orchestrator'] and
title in [
'Puppet_enterprise::Profile::Puppetdb',
'Puppet_enterprise::Profile::Master',
'Puppet_enterprise::Profile::Database',
'Puppet_enterprise::Profile::Orchestrator'
] and
nodes { deactivated is null and expired is null }
}").map |$nodes| { $nodes['title'] }
} else {
Expand Down
11 changes: 11 additions & 0 deletions hiera-rspec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
version: 5

defaults: # Used for any hierarchy level that omits these keys.
datadir: spec/data # This path is relative to hiera.yaml's directory.
data_hash: yaml_data # Use the built-in YAML backend.

hierarchy:
- name: 'rspec'
path: 'rspec.yaml'

Loading
Loading