Skip to content

Latest commit

 

History

History
968 lines (519 loc) · 17.7 KB

REFERENCE.md

File metadata and controls

968 lines (519 loc) · 17.7 KB

Reference

Table of Contents

Classes

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. Defaults to true

Default value: true

manage_setup

Data type: Boolean

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

Default value: true

repo_name

Data type: String

Name of the InfluxDB repository if using $manage_repo. Defaults to influxdb2

Default value: 'influxdb2'

version

Data type: String

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

Default value: '2.1.1'

archive_source

Data type: String

URL containing an InfluxDB archive if not installing from a repository. Defaults to version 2-2.1.1 on amd64 architechture.

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

use_ssl

Data type: Boolean

Whether to use http or https connections. Defaults to true (https).

Default value: true

manage_ssl

Data type: Boolean

Whether to manage the SSL bundle for https connections. Defaults to true.

Default value: true

ssl_cert_file

Data type: String

SSL certificate to be used by the influxdb service. Defaults to the agent certificate issued by the Puppet CA for the local machine.

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. Defaults to the private key of the local machine for generating a CSR for the Puppet CA

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. Defaults to the Puppet CA.

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

host

Data type: String

fqdn of the host running InfluxDB. Defaults to the fqdn of the local machine

intial_org

Name of the initial organization to use during initial setup. Defaults to puppetlabs

intial_bucket

Name of the initial bucket to use during initial setup. Defaults to puppet_data

admin_user

Data type: String

Name of the administrative user to use during initial setup. Defaults to admin

Default value: 'admin'

admin_pass

Data type: Sensitive[String[1]]

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

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']

port

Data type: Integer

initial_org

Data type: String

initial_bucket

Data type: String

influxdb::profile::toml

Installs the toml-rb gem inside Puppet server

Examples

Basic usage
include influxdb::profile::toml

Parameters

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

version

Data type: String

Default value: '2.1.1'

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

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

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"=>0, "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

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

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

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

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

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

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)

The influxdb::retrieve_token function.

Returns: Any

uri

Data type: String

token_name

Data type: String

admin_token_file

Data type: String

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