influxdb_database - Manage InfluxDB databases
New in version 2.1.
Synopsis
- Manage InfluxDB databases
Requirements (on host that executes module)
- python >= 2.6
- influxdb >= 0.9
Options
| parameter | required | default | choices | comments |
|---|---|---|---|---|
| database_name | yes | Name of the database that will be created/destroyed | ||
| hostname | yes | The hostname or IP address on which InfluxDB server is listening | ||
| password | no | root | Password that will be used to authenticate against InfluxDB server | |
| port | no | 8086 | The port on which InfluxDB server is listening | |
| state | no | present |
| Determines if the database should be created or destroyed |
| username | no | root | Username that will be used to authenticate against InfluxDB server |
Examples
# Example influxdb_database command from Ansible Playbooks
- name: Create database
influxdb_database:
hostname: "{{influxdb_ip_address}}"
database_name: "{{influxdb_database_name}}"
state: present
- name: Destroy database
influxdb_database:
hostname: "{{influxdb_ip_address}}"
database_name: "{{influxdb_database_name}}"
state: absent
- name: Create database using custom credentials
influxdb_database:
hostname: "{{influxdb_ip_address}}"
username: "{{influxdb_username}}"
password: "{{influxdb_password}}"
database_name: "{{influxdb_database_name}}"
state: present
Status
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.4/influxdb_database_module.html