https://github.com/coding-to-music/ansible-role-influxdb
From / By https://github.com/boutetnico/ansible-role-influxdb
git init
git add .
git remote remove origin
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:coding-to-music/ansible-role-influxdb.git
git push -u origin main
create an inventory file similar to inventory.sample
# if username on the control node is the SAME on the managed nodes
ansible myhosts -m ping -i inventory
# if username on the control node is different from the managed nodes
ansible myhosts -m ping -i inventory -u root --ask-pass
This role installs and configures InfluxDB.
Ansible 2.10 or newer.
- Debian - 11 (Bullseye)
- Debian - 12 (Bookworm)
- Ubuntu - 20.04 (Focal Fossa)
- Ubuntu - 22.04 (Jammy Jellyfish)
Variable | Required | Default | Choices | Comments |
---|---|---|---|---|
influxdb_dependencies | yes | [apt-transport-https,curl,gnupg] |
list | |
influxdb_package_state | yes | present |
string | Use latest to upgrade. |
influxdb_host | yes | http://localhost:8086 |
string | |
influxdb_config_path | yes | /etc/influxdb |
string | |
influxdb_bolt_path | yes | /var/lib/influxdb/influxd.bolt |
string | |
influxdb_engine_path | yes | /var/lib/influxdb/engine |
string | |
influxdb_config | yes | {} |
dict | Main configuration object. |
influxdb_primary_org | yes | example-org |
string | Primary organization name. |
influxdb_primary_bucket | yes | example-bucket |
string | Primary bucket name. |
influxdb_primary_username | yes | example-user |
string | Primary username. |
influxdb_primary_password | yes | ExAmPl3PA55W0rD |
string | Password for primary user. |
influxdb_admin_token | yes | EXAMPLE-TOKEN |
string | Token for admin user. |
influxdb_orgs | yes | [] |
list | Additional orgs to create. |
influxdb_users | yes | [] |
list | Additional users to create. |
influxdb_buckets | yes | [] |
list | Additional buckets to create. |
influxdb_service_enabled | yes | true |
bool | Start InfluxDB at boot. |
influxdb_service_state | yes | started |
bool | Use started or stopped . |
None
- hosts: all
roles:
- role: ansible-role-influxdb
influxdb_orgs:
- name: main-org
description: Main organization
- name: guest-org
influxdb_users:
- name: admin01
org: main-org
password: secretPassword
- name: guest01
org: guest-org
password: secretPassword
influxdb_buckets:
- name: bucket01
description: First bucket
org: main-org
retention: 1d
- name: bucket02
org: main-org
molecule test --all
MIT