juliendufresne.influxdb
Ansible Role InfluxDB
This role helps you easily install and manage InfluxDB.
You can manage users and databases using the influxdb_users
and influxdb_databases
variables.
Supported Platforms
Distribution | Last Checked | From Scratch | Idempotency |
---|---|---|---|
CentOS 7.2.1511 (Core) | 2016-08-06 18:40:07 | ||
Debian 7.10 (wheezy) | 2016-08-06 18:41:39 | ||
Debian 8.4 (jessie) | 2016-08-06 18:43:44 | ||
Ubuntu 12.04 (precise) | 2016-08-06 18:45:21 | ||
Ubuntu 14.04 (trusty) | 2016-08-06 18:47:32 | ||
Ubuntu 15.04 (vivid) | 2016-08-06 18:49:37 | ||
Ubuntu 15.10 (wily) | 2016-08-06 18:51:39 | ||
Ubuntu 16.04 (xenial) | 2016-08-06 18:53:35 |
Table generated using test-ansible-roles
Requirements
This role requires Ansible version 2.1.0 and above (for using apt_repository
).
Module influxdb_user
This role includes a module for managing InfluxDB users. It can:
- Make sure a user exists or does not exist
- Create either an admin user or a standard user
- Manage user access to databases (NO, READ, WRITE, or ALL privileges)
- Add specified permissions to existing ones
For more information about this module, check its dedicated documentation.
Note: You can use this module by itself or via the
influxdb_users
variable.
Role Variables
All variables have default values. You can run this role with the default settings.
Global Options
Name | Description | Default |
---|---|---|
influxdb_install_user | User to be used for installation. | "root" |
influxdb_user | InfluxDB user | "influxdb" |
influxdb_group | InfluxDB group | "influxdb" |
influxdb_config_dir | Location of configuration files | "/etc/influxdb" |
influxdb_config_file | Name of the configuration file | "influxdb.conf" |
influxdb_users | Manage users (see below) | [] |
influxdb_databases | Manage databases (see below) | ["_internal"] |
Managing Users
The influxdb_users
variable lets you create and manage user permissions.
For each entry, the script will:
- Create the user if it doesn’t exist
- Update the user password if different
- Grant admin role if
type
is set toadmin
- Remove any old database rights
- Assign specified rights for each database.
Example:
influxdb_users:
- name: admin
admin: yes
password: admin
- name: grafana
password: grafana
grants: "measurement:READ" # Gives READ permission on the measurement table for user grafana
- type: user
name: telegraf
password: telegraf
grants: "measurement:WRITE" # Gives WRITE permission on the measurement table for user telegraf
- name: john
password: john
grants: "measurement:ALL" # Gives READ and WRITE permission on the measurement table for user telegraf
For safety, it does not delete any databases.
Managing Databases
Make sure the databases listed in influxdb_databases
are created.
Example:
influxdb_databases:
- "_internal"
- "grafana"
For safety, it does not delete any databases.
Configuration File Options
You can specify each parameter in the configuration file.
Variable format: influxdb__<block-name>__<parameter_in_snake_case>
Name | Description | Default |
---|---|---|
influxdb_config__meta__dir | "/var/lib/influxdb/meta" | |
influxdb_config__meta__retention_autocreate | "true" | |
... (and many more options like the above) |
Dependencies
None.
Example Playbook
Here's an example of how to use this role (with variables passed as parameters):
- hosts: servers
roles:
- { role: juliendufresne.influxdb }
License
MIT / BSD
Author Information
This role was created in 2016 by Julien Dufresne.
Fully configurable influxdb installation for Debian/Ubuntu Linux.
ansible-galaxy install juliendufresne.influxdb