dgolja / golja-influxdb

Puppet module for InfluxDB
Apache License 2.0
19 stars 70 forks source link

Add InfluxDB providers #75

Closed tobias-urdin closed 1 year ago

tobias-urdin commented 5 years ago

This implements the base InfluxDB provider that can be used by provider resources to talk to the InfluxDB API and perform actions.

Initial implementation contains the influxdb_database and influxdb_retention policy resources which can be used to manage databases and retention policies in InfluxDB.

The resources must be executed on the same node as InfluxDB is running because it talks to the API over http://localhost:8086.

class { '::influxdb':
  manage_repos => true,
}

influxdb_retention_policy { 'myrp1@mydb1':
  duration => '1h',
  default  => false,
}

influxdb_retention_policy { 'myrp2@mydb1':
  duration => '20h',
  default  => true,
}

influxdb_database { 'mydb1': }

influxdb_database { 'mydb2': }

influxdb_retention_policy { 'myrp1@mydb2':
  duration    => '4h10m10s',
  replication => 2,
}

All of it should come with pretty decent unit testing, some things could be improved but does the job for now. Also throwing in a lint fix in params.pp that caused errors.

Best regards Tobias

tobias-urdin commented 5 years ago

@dgolja Might be interesting stuff :)