{"id":15156660,"url":"https://github.com/puppetlabs/influxdb","last_synced_at":"2025-04-09T14:15:38.338Z","repository":{"id":40558751,"uuid":"424093553","full_name":"puppetlabs/influxdb","owner":"puppetlabs","description":null,"archived":false,"fork":false,"pushed_at":"2024-12-06T09:51:14.000Z","size":330,"stargazers_count":2,"open_issues_count":6,"forks_count":22,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-02T08:44:37.571Z","etag":null,"topics":["module","supported"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/puppetlabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-03T04:40:55.000Z","updated_at":"2024-12-06T09:51:19.000Z","dependencies_parsed_at":"2022-08-09T23:01:05.722Z","dependency_job_id":"a44c7a30-6c77-4ce6-9b2d-719ed46c80d0","html_url":"https://github.com/puppetlabs/influxdb","commit_stats":{"total_commits":169,"total_committers":17,"mean_commits":9.941176470588236,"dds":0.591715976331361,"last_synced_commit":"1f80c3a3a939b3ceb5c402957a083d77a0dd6ffb"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Finfluxdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Finfluxdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Finfluxdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puppetlabs%2Finfluxdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/puppetlabs","download_url":"https://codeload.github.com/puppetlabs/influxdb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054194,"owners_count":21039952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["module","supported"],"created_at":"2024-09-26T19:40:39.292Z","updated_at":"2025-04-09T14:15:38.312Z","avatar_url":"https://github.com/puppetlabs.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# influxdb\n\n## Table of Contents\n\n- [influxdb](#influxdb)\n  - [Table of Contents](#table-of-contents)\n  - [Description](#description)\n  - [Setup](#setup)\n    - [What influxdb affects](#what-influxdb-affects)\n    - [Beginning with InfluxDB](#beginning-with-influxdb)\n  - [Usage](#usage)\n    - [Installation](#installation)\n    - [Resource management](#resource-management)\n    - [SSL](#ssl)\n  - [Limitations](#limitations)\n- [Supporting Content](#supporting-content)\n  - [Articles](#articles)\n  - [Videos](#videos)\n\n## Description\n\nThis module provides type and provider implementations to manage the resources of an InfluxDB 2.x instance.  Because the [InfluxDB 2.0 api](https://docs.influxdata.com/influxdb/v2.1/api/) provides an interface to these resources, the module is able to manage an InfluxDB server running either on the local machine or remotely.\n\n## Setup\n\n### What influxdb affects\n\nThe primary things this module provides are:\n\n* Installation of InfluxDB repositories and packages\n* Initial setup of the InfluxDB application\n* Configuration and management of InfluxDB resources such as organizations, buckets, etc\n\nThe first two items are provided by the `influxdb` class and are restricted to an InfluxDB instance running on the local machine.\n\nInfluxDB resources are managed by the various types and providers. Because we need to be able to enumerate and query resources on either a local or remote machine, the resources accept these parameters with the following defaults:\n\n* host - fqdn\n* port - 8086\n* token_file - ~/.influxdb_token\n* use_ssl - true\n* token (optional)\n\nSpecifying a `token` in `Sensitive[String]` format is optional, but recommended. See [Beginning with Influxdb](#beginning-with-influxdb) for more info.\n\nNote that you are *not* able to use multiple combinations of these options in a given catalog.  Each provider class will set these values when first instantiated and will use the first value that it finds.  Therefore, it is best to use resource defaults for these parameters in your manifest, e.g.\n\n```puppet\nclass my_profile::my_class(\n  Sensitive[String] $my_token,\n) {\n  Influxdb_bucket {\n    token =\u003e $my_token,\n  }\n}\n```\n\nSee [Usage](#usage) for more information about these use cases.\n\n### Beginning with InfluxDB\n\nThe easiest way to get started using this module is by including the `influxdb` class to install and perform initial setup of the application.\n\n```puppet\ninclude influxdb\n```\n\nDoing so will:\n\n* Install the `influxdb2` package from either a repository or archive source.\n* Configure and start the `influxdb` service\n* Perform initial setup of the InfluxDB application, consisting of\n  * An initial organization and bucket\n  * An administrative token saved to `~/.influxdb_token` by default\n\nThe type and provider code is able to use the token saved in this file, provided it is present on the node applying the catalog. However, it is recommended to specify the token via the `influxdb::token` parameter after initial setup.\n\n## Usage\n\n### Installation\n\nAs detailed in [Beginning with Influxdb](#beginning-with-influxdb), the `influxdb` class manages installation and initial setup of InfluxDB. The following aspects are managed by default:\n\n* InfluxDB repository\n* SSL\n* Initial setup, including the initial organization and bucket resources\n* Token with permissions to read and write Telegrafs and buckets within the initial organization\n\nNote that the admin user and password can be set prior to initial setup, but cannot be managed afterwards.  These must be changed manually using the `influx` cli.\n\nFor example, to use a different initial organization and bucket, set the parameters in hiera:\n\n```yaml\ninfluxdb::initial_org: 'my_org'\ninfluxdb::initial_bucket: 'my_bucket'\n```\n\nOr use a class-like declaration\n\n```puppet\nclass { 'influxdb':\n  initial_org    =\u003e 'my_org',\n  initial_bucket =\u003e 'my_bucket',\n}\n```\n\n### Resource management\n\nFor managing InfluxDB resources, this module provides several types and providers that use the [InfluxDB 2.0 api](https://docs.influxdata.com/influxdb/v2.1/api/).  As mentioned in [What influxdb affects](#what-influxdb-affects), the resources accept parameters to determine how to connect to the host which must be unique per resource type.  For example, to create an organization and bucket and specify a token and non-standard port:\n\n```puppet\nclass my_profile::my_class(\n  Sensitive[String] $token,\n) {\n  influxdb_org { 'my_org':\n    ensure =\u003e present,\n    token  =\u003e $token,\n    port   =\u003e 1234,\n  }\n\n  influxdb_bucket { 'my_bucket':\n    ensure =\u003e present,\n    org    =\u003e 'my_org',\n    labels =\u003e ['my_label1', 'my_label2'],\n    token  =\u003e $token,\n    port   =\u003e 1234,\n  }\n}\n```\n\nResource defaults are also a good option:\n\n```puppet\nInfluxdb_org {\n  token =\u003e $token,\n  port  =\u003e 1234,\n}\n\nInfluxdb_bucket {\n  token =\u003e $token,\n  port  =\u003e 1234,\n}\n```\n\nNote that the `influxdb_bucket` will produce a warning for each specified label that does not currently exist.\n\nIf InfluxDB is running locally and there is an admin token saved at `~/.influxdb_token`, it will be used in API calls if the `token` parameter is unset.  However, it is recommended to set the token in hiera as an eyaml-encrypted string.  For example:\n\n```yaml\ninfluxdb::token: '\u003ceyaml_string\u003e'\nlookup_options:\n   influxdb::token:\n     convert_to: \"Sensitive\"\n```\n\nFor more complex resource management, here is an example of:\n\n* Looking up a list of buckets\n* Creating a hash with `ensure =\u003e present` for each bucket\n* Creating the bucket resources with a default org of `myorg` and retention policy of 30 days.\n\nHiera data:\n\n```yaml\nprofile::buckets:\n  - 'bucket1'\n  - 'bucket2'\n  - 'bucket3'\n```\n\nPuppet code:\n\n```puppet\nclass my_profile::my_class {\n  $buckets = lookup('profile::buckets')\n  $bucket_hash = $buckets.reduce({}) |$memo, $bucket| {\n    $tmp = $memo.merge({\"$bucket\" =\u003e { \"ensure\" =\u003e present } })\n    $tmp\n  }\n\n  create_resources(\n    influxdb_bucket,\n    $bucket_hash,\n    {\n      'org'        =\u003e 'myorg',\n      retention_rules =\u003e [{\n        'type' =\u003e 'expire',\n        'everySeconds' =\u003e 2592000,\n        'shardGroupDurationSeconds' =\u003e 604800,\n      }]\n    }\n  )\n```\n\n### SSL\n\n#### Defaults\n\nThe InfluxDB application and Puppet resources can be configured to use SSL.  The [use_ssl](https://forge.puppet.com/modules/puppetlabs/influxdb/reference#use_ssl) parameter of the main class and all resources defaults to `true`, meaning SSL will be used in all communications.  If you wish to disable it, setting `influxdb::use_ssl` to `false` will do so for the application.  Passing `use_ssl` to resources will cause them to query the application without using SSL.\n\nThe certificates used in SSL communication default to those issued by the Puppet CA.  The application will use the [ssl certificate](https://forge.puppet.com/modules/puppetlabs/influxdb/reference#ssl_cert_file) and [private key](https://forge.puppet.com/modules/puppetlabs/influxdb/reference#ssl_key_file) used by the Puppet agent on the local machine running InfluxDB.  Applications that query InfluxDB, such as Telegraf and the resources in this module, need to provide a CA certificate issued by the same CA to be trusted.  See the [puppet_operational_dashboards](https://forge.puppet.com/modules/puppetlabs/puppet_operational_dashboards/reference#puppet_operational_dashboardstelegrafagent) module for an example.\n\n#### Configuration\n\nIf you wish to manage the certificate files yourself, you can set [manage_ssl](https://forge.puppet.com/modules/puppetlabs/influxdb/reference#manage_ssl).  SSL will still be enabled and used by the resources, but the module will not manage the contents of the certificate files.\n\nIf you need to use certificates issued by a CA other than the Puppet CA, you can do so by using the [ssl_trust_store](https://www.puppet.com/docs/puppet/8/configuration.html#ssl-trust-store) option of the Puppet agent.  First, set the [use_system_store](https://forge.puppet.com/modules/puppetlabs/influxdb/reference#use_system_store) parameter to `true` in the main class and all resources of this module.\n\nNext, save your CA bundle to disk on the node managing your InfluxDB server.  Set the `ssl_trust_store` option in its `puppet.conf` to contain the path to this file.  This will cause all of the api calls made by this module to include your CA bundle.\n\n## Limitations\n\nThis module is incompatible with InfluxDB 1.x.  Migrating data from 1.x to 2.x must be done manually.  For more information see [here](https://docs.influxdata.com/influxdb/v2.1/upgrade/v1-to-v2/).\n\n## Supporting Content\n\n### Articles\n\nThe [Support Knowledge base](https://support.puppet.com/hc/en-us) is a searchable repository for technical information and how-to guides for all Puppet products.\n\nThis Module has the following specific Article(s) available:\n\n1. [Manage the installation and configuration of metrics dashboards using the puppetlabs-puppet_operational_dashboards module for Puppet Enterprise](https://support.puppet.com/hc/en-us/articles/6374662483735)\n2. [Monitor the performance of your PuppetDB](https://support.puppet.com/hc/en-us/articles/5918309176727)\n3. [High swap usage on your primary server or replica in Puppet Enterprise](https://support.puppet.com/hc/en-us/articles/8118659796759)\n\n### Videos\n\nThe [Support Video Playlist](https://youtube.com/playlist?list=PLV86BgbREluWKzzvVulR74HZzMl6SCh3S) is a resource of content generated by the support team\n\nThis Module has the following specific video content  available:\n\n1. [Puppet Metrics Overview](https://youtu.be/LiCDoOUS4hg)\n2. [Collecting and Displaying Puppet Metrics](https://youtu.be/13sBMQGDqsA)\n3. [Interpreting Puppet Metrics](https://youtu.be/09iDO3DlKMQ)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuppetlabs%2Finfluxdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpuppetlabs%2Finfluxdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuppetlabs%2Finfluxdb/lists"}