community.general.influxdb_database (0.1.1) — module

Manage InfluxDB databases

Authors: Kamil Szczygiel (@kamsz)

preview | supported by community

Install collection

Install with ansible-galaxy collection install community.general:==0.1.1


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.1

Description

Manage InfluxDB databases.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Example influxdb_database command from Ansible Playbooks
- name: Create database
  influxdb_database:
      hostname: "{{influxdb_ip_address}}"
      database_name: "{{influxdb_database_name}}"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Destroy database
  influxdb_database:
      hostname: "{{influxdb_ip_address}}"
      database_name: "{{influxdb_database_name}}"
      state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create database using custom credentials
  influxdb_database:
      hostname: "{{influxdb_ip_address}}"
      username: "{{influxdb_username}}"
      password: "{{influxdb_password}}"
      database_name: "{{influxdb_database_name}}"
      ssl: yes
      validate_certs: yes

Inputs

    
ssl:
    description:
    - Use https instead of http to connect to InfluxDB server.
    type: bool

path:
    description:
    - The path on which InfluxDB server is accessible
    type: str

port:
    default: 8086
    description:
    - The port on which InfluxDB server is listening
    type: int

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Determines if the database should be created or destroyed.
    type: str

proxies:
    description:
    - HTTP(S) proxy to use for Requests to connect to InfluxDB server.
    type: dict

retries:
    default: 3
    description:
    - Number of retries client will try before aborting.
    - C(0) indicates try until success.
    type: int

timeout:
    description:
    - Number of seconds Requests will wait for client to establish a connection.
    type: int

use_udp:
    description:
    - Use UDP to connect to InfluxDB server.
    type: bool

hostname:
    default: localhost
    description:
    - The hostname or IP address on which InfluxDB server is listening.
    - Since Ansible 2.5, defaulted to localhost.
    type: str

password:
    aliases:
    - login_password
    default: root
    description:
    - Password that will be used to authenticate against InfluxDB server.
    - Alias C(login_password) added in Ansible 2.5.
    type: str

udp_port:
    default: 4444
    description:
    - UDP port to connect to InfluxDB server.
    type: int

username:
    aliases:
    - login_username
    default: root
    description:
    - Username that will be used to authenticate against InfluxDB server.
    - Alias C(login_username) added in Ansible 2.5.
    type: str

database_name:
    description:
    - Name of the database.
    required: true
    type: str

validate_certs:
    default: true
    description:
    - If set to C(no), the SSL certificates will not be validated.
    - This should only set to C(no) used on personally controlled sites using self-signed
      certificates.
    type: bool