Forge Home

influxdb

Installs and configures InfluxDB 2

22,248 downloads

5,434 latest version

4.7 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 2.4.0 (latest)
  • 2.3.2
  • 2.3.1
  • 2.3.0
  • 2.2.0
  • 2.1.0
  • 2.0.0
  • 1.6.0
  • 1.5.1
  • 1.5.0
  • 1.4.0
  • 1.3.1
  • 1.3.0
  • 1.2.1
  • 1.2.0
  • 1.1.0
  • 1.0.0
  • 0.3.0
  • 0.2.1
  • 0.2.0
released Sep 25th 2023
This version is compatible with:
  • Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
  • Puppet >= 7.0.0 < 9.0.0
  • , , , , , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'puppetlabs-influxdb', '2.4.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add puppetlabs-influxdb
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install puppetlabs-influxdb --version 2.4.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

puppetlabs/influxdb — version 2.4.0 Sep 25th 2023

Reference

Table of Contents

Classes

  • influxdb: Installs, configures, and performs initial setup of InfluxDB 2.x
  • influxdb::profile::toml: Installs the toml-rb gem inside Puppet server and agent

Resource types

  • influxdb_auth: Manages authentication tokens in InfluxDB
  • influxdb_bucket: Manages InfluxDB buckets
  • influxdb_dbrp: Manages dbrps, or database and retention policy mappings. These provide backwards compatibilty for 1.x queries. Note that these are automatically created by the influxdb_bucket resource, so it isn't necessary to use this resource unless you need to customize them.
  • influxdb_label: Manages labels in InfluxDB
  • influxdb_org: Manages organizations in InfluxDB
  • influxdb_setup: Manages initial setup of InfluxDB. It is recommended to use the influxdb::install class instead of this resource directly.
  • influxdb_user: Manages users in InfluxDB. Note that currently, passwords can only be set upon creating the user and must be updated manually using the cli. A user must be added to an organization to be able to log in.

Functions

Classes

influxdb

Installs, configures, and performs initial setup of InfluxDB 2.x

Examples

Basic usage
include influxdb

class { 'influxdb':
  initial_org    => 'my_org',
  initial_bucket => 'my_bucket',
}

Parameters

The following parameters are available in the influxdb class:

manage_repo

Data type: Boolean

Whether to manage a repository to provide InfluxDB packages.

Default value: false

manage_setup

Data type: Boolean

Whether to perform initial setup of InfluxDB. This will create an initial organization, bucket, and admin token.

Default value: true

repo_name

Data type: String

Name of the InfluxDB repository if using $manage_repo.

Default value: 'influxdb2'

version

Data type: String

Version of InfluxDB to install. Changing this is not recommended.

Default value: '2.6.1'

archive_source

Data type: Variant[String,Boolean[false]]

URL containing an InfluxDB archive if not installing from a repository or false to disable installing from source.

Default value: 'https://dl.influxdata.com/influxdb/releases/influxdb2-2.6.1-linux-amd64.tar.gz'

use_ssl

Data type: Boolean

Whether to use http or https connections.

Default value: true

manage_ssl

Data type: Boolean

Whether to manage the SSL bundle for https connections.

Default value: true

use_system_store

Data type: Boolean

Whether to use the system store for SSL connections.

Default value: false

ssl_cert_file

Data type: String

SSL certificate to be used by the influxdb service.

Default value: "/etc/puppetlabs/puppet/ssl/certs/${trusted['certname']}.pem"

ssl_key_file

Data type: String

Private key used in the CSR for the certificate specified by $ssl_cert_file.

Default value: "/etc/puppetlabs/puppet/ssl/private_keys/${trusted['certname']}.pem"

ssl_ca_file

Data type: String

CA certificate issued by the CA which signed the certificate specified by $ssl_cert_file.

Default value: '/etc/puppetlabs/puppet/ssl/certs/ca.pem'

host

Data type: Stdlib::Host

fqdn of the host running InfluxDB.

Default value: $facts['networking']['fqdn']

port

Data type: Stdlib::Port::Unprivileged

port of the InfluxDB service.

Default value: 8086

initial_org

Data type: String[1]

Name of the initial organization to use during initial setup.

Default value: 'puppetlabs'

initial_bucket

Data type: String[1]

Name of the initial bucket to use during initial setup.

Default value: 'puppet_data'

admin_user

Data type: String

Name of the administrative user to use during initial setup.

Default value: 'admin'

admin_pass

Data type: Sensitive[String[1]]

Password for the administrative user in Sensitive format used during initial setup.

Default value: Sensitive('puppetlabs')

token_file

Data type: String

File on disk containing an administrative token. This class will write the token generated as part of initial setup to this file. Note that functions or code run in Puppet server will not be able to use this file, so setting $token after setup is recommended.

Default value: $facts['identity']['user']

repo_gpg_key_id

Data type: String[1]

ID of the GPG signing key

Default value: '9D539D90D3328DC7D6C8D3B9D8FF8E1F7DF8B07E'

repo_url

Data type: Optional[String]

URL of the Package repository

Default value: undef

repo_gpg_key_url

Data type: Stdlib::HTTPSUrl

URL of the GPG signing key

Default value: 'https://repos.influxdata.com/influxdata-archive_compat.key'

influxdb::profile::toml

Installs the toml-rb gem inside Puppet server and agent

Examples

Basic usage
include influxdb::profile::toml

Parameters

The following parameters are available in the influxdb::profile::toml class:

version

Data type: String

Version of the toml-rb gem to install

Default value: '2.1.1'

install_options_server

Data type: Array[String[1]]

Pass additional parameters to the puppetserver gem installation

Default value: []

install_options_agent

Data type: Array[String[1]]

Pass additional parameters to the puppetserver gem installation

Default value: []

Resource types

influxdb_auth

Manages authentication tokens in InfluxDB

Examples

influxdb_auth {"telegraf read token":
  ensure        => present,
  org           => 'my_org'
  permissions   => [
    {
      "action"   => "read",
      "resource" => {
        "type"   => "telegrafs"
      }
    },
  ],
}

Properties

The following properties are available in the influxdb_auth type.

ensure

Data type: Enum[present, absent]

Whether the token should be present or absent on the target system.

Default value: present

force

Data type: Boolean

Recreate resource if immutable property changes

host

Data type: Optional[String]

The host running InfluxDB

name

Data type: String

Name of the token. Note that InfluxDB does not currently have a human readable identifer for token, so for convinience we use the description property as the namevar of this resource

org

Data type: String

The organization that owns the token

permissions

Data type: Array[Hash]

List of permissions granted by the token

port

Data type: Optional[Integer]

Port used by the InfluxDB service

Default value: 8086

status

Data type: Enum[active, inactive]

Status of the token

Default value: active

token

Data type: Optional[Sensitive[String]]

Administrative token used for authenticating API calls

token_file

Data type: Optional[String]

File on disk containing an administrative token

use_ssl

Data type: Boolean

Whether to enable SSL for the InfluxDB service

Default value: true

use_system_store

Data type: Boolean

Whether to use the system store for SSL connections

user

Data type: Optional[String]

User to scope authorization to

influxdb_bucket

Manages InfluxDB buckets

Examples

influxdb_bucket {'my_bucket':
  ensure  => present,
  org     => 'my_org',
  labels  => ['my_label1', 'my_label2'],
  require => Influxdb_org['my_org'],
}

Properties

The following properties are available in the influxdb_bucket type.

create_dbrp

Data type: Boolean

Whether to create a "database retention policy" mapping to allow for legacy access

Default value: true

ensure

Data type: Enum[present, absent]

Whether the bucket should be present or absent on the target system.

Default value: present

host

Data type: Optional[String]

The host running InfluxDB

labels

Data type: Optional[Array[String]]

Labels to apply to the bucket. For convenience, these will be created automatically without the need to create influxdb_label resources

members

Data type: Optional[Array[String]]

List of users to add as members of the bucket. For convenience, these will be created automatically without the need to create influxdb_user resources

name

Data type: String

Name of the bucket

org

Data type: String

Organization which the buckets belongs to

port

Data type: Optional[Integer]

Port used by the InfluxDB service

Default value: 8086

retention_rules

Data type: Array

Rules to determine retention of data inside the bucket

Default value: [{"type"=>"expire", "everySeconds"=>7776000, "shardGroupDurationSeconds"=>604800}]

token

Data type: Optional[Sensitive[String]]

Administrative token used for authenticating API calls

token_file

Data type: Optional[String]

File on disk containing an administrative token

use_ssl

Data type: Boolean

Whether to enable SSL for the InfluxDB service

Default value: true

use_system_store

Data type: Boolean

Whether to use the system store for SSL connections

influxdb_dbrp

This type provides the ability to manage InfluxDB dbrps

Examples

influxdb_dbrp {'my_bucket':
  ensure => present,
  org    => 'my_org',
  bucket => 'my_bucket',
  rp     => 'Forever',
}

Properties

The following properties are available in the influxdb_dbrp type.

bucket

Data type: String

The bucket to map to the retention policy to

ensure

Data type: Enum[present, absent]

Whether the dbrp should be present or absent on the target system.

Default value: present

host

Data type: Optional[String]

The host running InfluxDB

is_default

Data type: Optional[Boolean]

Whether this should be the default policy

Default value: true

name

Data type: String

Name of the dbrp to manage in InfluxDB

org

Data type: String

Name of the organization that owns the mapping

port

Data type: Optional[Integer]

Port used by the InfluxDB service

Default value: 8086

rp

Data type: String

Name of the InfluxDB 1.x retention policy

token

Data type: Optional[Sensitive[String]]

Administrative token used for authenticating API calls

token_file

Data type: Optional[String]

File on disk containing an administrative token

use_ssl

Data type: Boolean

Whether to enable SSL for the InfluxDB service

Default value: true

use_system_store

Data type: Boolean

Whether to use the system store for SSL connections

influxdb_label

Manages labels in InfluxDB

Examples

influxdb_label {'puppetlabs/influxdb':
  ensure  => present,
  org     => 'puppetlabs',
}

Properties

The following properties are available in the influxdb_label type.

ensure

Data type: Enum[present, absent]

Whether the label should be present or absent on the target system.

Default value: present

host

Data type: Optional[String]

The host running InfluxDB

name

Data type: String

Name of the label

org

Data type: String

Organization the label belongs to

port

Data type: Optional[Integer]

Port used by the InfluxDB service

Default value: 8086

properties

Data type: Optional[Hash]

Key/value pairs associated with the label

token

Data type: Optional[Sensitive[String]]

Administrative token used for authenticating API calls

token_file

Data type: Optional[String]

File on disk containing an administrative token

use_ssl

Data type: Boolean

Whether to enable SSL for the InfluxDB service

Default value: true

use_system_store

Data type: Boolean

Whether to use the system store for SSL connections

influxdb_org

Manages organizations in InfluxDB

Examples

influxdb_org {'puppetlabs':
  ensure  => present,
}

Properties

The following properties are available in the influxdb_org type.

description

Data type: Optional[String]

Optional description for a given org

ensure

Data type: Enum[present, absent]

Whether the organization should be present or absent on the target system.

Default value: present

host

Data type: Optional[String]

The host running InfluxDB

members

Data type: Optional[Array[String]]

A list of users to add as members of the organization

name

Data type: String

Name of the organization to manage in InfluxDB

port

Data type: Optional[Integer]

Port used by the InfluxDB service

Default value: 8086

token

Data type: Optional[Sensitive[String]]

Administrative token used for authenticating API calls

token_file

Data type: Optional[String]

File on disk containing an administrative token

use_ssl

Data type: Boolean

Whether to enable SSL for the InfluxDB service

Default value: true

use_system_store

Data type: Boolean

Whether to use the system store for SSL connections

influxdb_setup

Manages initial setup of InfluxDB. It is recommended to use the influxdb::install class instead of this resource directly.

Examples

influxdb_setup {'<influx_fqdn>':
  ensure     => 'present',
  token_file => <path_to_token_file>,
  bucket     => 'my_bucket',
  org        => 'my_org',
  username   => 'admin',
  password   => 'admin',
}

Properties

The following properties are available in the influxdb_setup type.

bucket

Data type: String

Name of the initial bucket to create

ensure

Data type: Enum[present, absent]

Whether initial setup has been performed. present/absent is determined by the response from the /setup api

Default value: present

host

Data type: Optional[String]

The host running InfluxDB

org

Data type: String

Name of the initial organization to create

password

Data type: Sensitive[String]

Initial admin user password

port

Data type: Optional[Integer]

Port used by the InfluxDB service

Default value: 8086

token

Data type: Optional[Sensitive[String]]

Administrative token used for authenticating API calls

token_file

Data type: Optional[String]

File on disk containing an administrative token

use_ssl

Data type: Boolean

Whether to enable SSL for the InfluxDB service

Default value: true

use_system_store

Data type: Boolean

Whether to use the system store for SSL connections

username

Data type: String

Name of the initial admin user

Parameters

The following parameters are available in the influxdb_setup type.

name

namevar

Data type: String

The fqdn of the host running InfluxDB

influxdb_user

Manages users in InfluxDB. Note that currently, passwords can only be set upon creating the user and must be updated manually using the cli. A user must be added to an organization to be able to log in.

Examples

influxdb_user {'bob':
  ensure   => present,
  password => Sensitive('thisisbobspassword'),
}

influxdb_org {'my_org':
  ensure => present,
  members  => ['bob'],
}

Properties

The following properties are available in the influxdb_user type.

ensure

Data type: Enum[present, absent]

Whether the user should be present or absent on the target system.

Default value: present

host

Data type: Optional[String]

The host running InfluxDB

name

Data type: String

Name of the user

password

Data type: Optional[Sensitive[String]]

User password

port

Data type: Optional[Integer]

Port used by the InfluxDB service

Default value: 8086

status

Data type: Enum[active, inactive]

Status of the user

Default value: active

token

Data type: Optional[Sensitive[String]]

Administrative token used for authenticating API calls

token_file

Data type: Optional[String]

File on disk containing an administrative token

use_ssl

Data type: Boolean

Whether to enable SSL for the InfluxDB service

Default value: true

use_system_store

Data type: Boolean

Whether to use the system store for SSL connections

Functions

influxdb::from_toml

Type: Ruby 4.x API

The influxdb::from_toml function.

influxdb::from_toml(String $file)

The influxdb::from_toml function.

Returns: Any

file

Data type: String

influxdb::hosts_with_pe_profile

Type: Puppet Language

The influxdb::hosts_with_pe_profile function.

influxdb::hosts_with_pe_profile(String $profile)

The influxdb::hosts_with_pe_profile function.

Returns: Array

profile

Data type: String

influxdb::retrieve_token

Type: Ruby 4.x API

The influxdb::retrieve_token function.

influxdb::retrieve_token(String $uri, String $token_name, String $admin_token_file, Optional[Boolean] $use_system_store)

The influxdb::retrieve_token function.

Returns: Any

uri

Data type: String

token_name

Data type: String

admin_token_file

Data type: String

use_system_store

Data type: Optional[Boolean]

influxdb::retrieve_token(String $uri, String $token_name, Sensitive $admin_token, Optional[Boolean] $use_system_store)

The influxdb::retrieve_token function.

Returns: Any

uri

Data type: String

token_name

Data type: String

admin_token

Data type: Sensitive

use_system_store

Data type: Optional[Boolean]

influxdb::to_toml

Type: Ruby 4.x API

The influxdb::to_toml function.

influxdb::to_toml(Hash $hash)

The influxdb::to_toml function.

Returns: Any

hash

Data type: Hash