Skip to content

Latest commit

 

History

History
597 lines (323 loc) · 9.68 KB

REFERENCE.md

File metadata and controls

597 lines (323 loc) · 9.68 KB

Reference

Table of Contents

Classes

Defined types

Resource types

Classes

influxdb

Manages InfluxDB

Examples

class { '::influxdb':
  admin_username => $admin_username,
  admin_password => $admin_password,
}

class { '::influxdb':
  admin_username => $admin_username,
  admin_password => $admin_password,
  configuration  => {
    'data'  => {
      'dir'                     => '/mnt/influxdb/data',
      'wal-dir'                 => '/mnt/influxdb/wal',
      'max-series-per-database' => 0,
      'max-values-per-tag'      => 0,
    }
  },
  databases      => {
    'prometheus' => {
      'ensure' => present,
    },
  },
  users          => {
    'grafana' => {
      'password' => 'asdfghjkl!"§"!"$',
    },
    'prometheus' => {
      'password' => 'asdfghjkl!"§"!"$',
    },
  }
}

Parameters

The following parameters are available in the influxdb class.

ensure

Data type: Enum['present','absent']

  • Whether to create or destroy this resource

Default value: 'present'

ensure_package

Data type: Variant[String,Undef]

  • Overwrite $ensure for the package only. Used if package needs to be anything but 'present' or 'absent'

Default value: undef

admin_password

Data type: String

  • The password used for the main admin account
admin_username

Data type: String

  • The username used for the main admin account
configuration

Data type: Hash

  • The configuration to use. Default values will be provided for everything not written

Default value: {}

api_port

Data type: Integer

  • The port which to connect to InfluxDB

Default value: 8086

config_path

Data type: String

  • The path to the main configuration file

Default value: '/etc/influxdb/influxdb.conf'

group

Data type: String

  • The group used for permission on for everything

Default value: 'influxdb'

owner

Data type: String

  • The owner used for permission on for everything

Default value: 'influxdb'

databases

Data type: Hash[String, Hash[String, Any]]

  • Create the provided databases. The hash is passed on to infludb::database

Default value: {}

users

Data type: Hash[String, Hash[String, Any]]

  • Create the provided users. The hash is passed on to infludb::user via create_resources()

Default value: {}

influxdb::config

Manages the configuration of InfluxDB

Examples

Use main class

influxdb::install

Manages the installation of InfluxDB

Examples

Use main class

influxdb::service

Manages the service of InfluxDB

Examples

Use main class

Defined types

influxdb::database

Creates or destroys a database within InfluxDB

Examples

influxdb::database { 'my_database_name': }

Parameters

The following parameters are available in the influxdb::database defined type.

ensure

Data type: Enum['present','absent']

  • Create or destroy database

Default value: 'present'

name
  • (namevar) The name of the database
admin_password

Data type: String

Default value: $influxdb::admin_password

admin_username

Data type: String

Default value: $influxdb::admin_username

influxdb::retention_policy

Creates or destroys a retention policy on a database, within InfluxDB

Examples

influxdb::retention_policy { '1YearRetention':
  database => 'prometheus',
  duration => '8640h0m0s',
}

Parameters

The following parameters are available in the influxdb::retention_policy defined type.

ensure

Data type: Enum['present','absent']

  • Create or destroy retention policies

Default value: 'present'

name
  • (namevar) The name of the database
duration

Data type: String

shard_duration

Data type: Optional[String]

  • The duration in which to keep shards. Set to undef to let InfluxDB decide

Default value: undef

database

Data type: String

  • Which database the policy should be applied too
replicas

Data type: Integer

  • The amount of replicas to use (should be the same as the number of nodes)

Default value: 1

is_default

Data type: Boolean

  • Wheter the policy is the default for the database

Default value: true

admin_password

Data type: String

Default value: $influxdb::admin_password

admin_username

Data type: String

Default value: $influxdb::admin_username

influxdb::user

Create, destroy or update a user within InfluxDB

Examples

influxdb::user { 'read_only_user':
  password  => 'mySuperSecretPassWORD',
  privilege => 'READ',
  database  => 'my_database',
}

influxdb::user { 'admin2':
  password => 'Admin?Need?Better&Password',
  is_admin => true,
}

Parameters

The following parameters are available in the influxdb::user defined type.

privilege

Data type: Variant[Enum['READ', 'WRITE', 'ALL'],Undef]

  • What privileges to give the user

Default value: undef

is_admin

Data type: Boolean

  • Whether the user should be created as an admin or not

Default value: false

ensure

Data type: Enum['present','absent']

  • Create or destroy user

Default value: 'present'

database

Data type: Variant[String,Undef]

  • What database the user should have $privileges too (only for non-admins)

Default value: undef

password

Data type: Variant[String,Undef]

  • The plain-text password to give the user

Default value: undef

name
  • (namevar) The username of the user
admin_password

Data type: String

Default value: $influxdb::admin_password

admin_username

Data type: String

Default value: $influxdb::admin_username

Resource types

influxdb_auth

Setup http_auth in InfluxDB.

Properties

The following properties are available in the influxdb_auth type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

Parameters

The following parameters are available in the influxdb_auth type.

name

namevar

A unique name for the resource

admin_username

Admin username to manage the resource with

admin_password

Admin password to manage the resource with

config_path

Path to the main config file

influxdb_database

Create or update a database in InfluxDB.

Properties

The following properties are available in the influxdb_database type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

Parameters

The following parameters are available in the influxdb_database type.

name

namevar

A unique name for the resource

admin_username

Admin username to manage the resource with

admin_password

Admin password to manage the resource with

database

The database to create

influxdb_retention_policy

Create or update a user in InfluxDB.

Properties

The following properties are available in the influxdb_retention_policy type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

duration

The duration to keep data for

shard_duration

The duration to keep shards for

replicas

The amount of replicas to use

is_default

Whether or not this policy is the default for the database

Parameters

The following parameters are available in the influxdb_retention_policy type.

name

namevar

A unique name for the resource

admin_username

Admin username to manage the resource with

admin_password

Admin password to manage the resource with

retention_policy

The retention policy to create

database

The database the retention policy should be applied to

influxdb_user

Create or update a user in InfluxDB.

Properties

The following properties are available in the influxdb_user type.

ensure

Valid values: present, absent

The basic property that the resource should be in.

Default value: present

privilege

Which privilege to use

Parameters

The following parameters are available in the influxdb_user type.

name

namevar

A unique name for the resource

admin_username

Admin username to manage the resource with

admin_password

Admin password to manage the resource with

username

The user to create

password

Password for the user to create

is_admin

Whether to user is a admin or normal user

database

Which database to grant access to