community.general.influxdb_retention_policy – Manage InfluxDB retention policies¶
Note
This plugin is part of the community.general collection (version 1.3.6).
To install it use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.influxdb_retention_policy
.
Requirements¶
The below requirements are needed on the host that executes this module.
python >= 2.6
influxdb >= 0.9
requests
Parameters¶
Examples¶
# Example influxdb_retention_policy command from Ansible Playbooks
- name: Create 1 hour retention policy
community.general.influxdb_retention_policy:
hostname: "{{influxdb_ip_address}}"
database_name: "{{influxdb_database_name}}"
policy_name: test
duration: 1h
replication: 1
ssl: yes
validate_certs: yes
- name: Create 1 day retention policy
community.general.influxdb_retention_policy:
hostname: "{{influxdb_ip_address}}"
database_name: "{{influxdb_database_name}}"
policy_name: test
duration: 1d
replication: 1
- name: Create 1 week retention policy
community.general.influxdb_retention_policy:
hostname: "{{influxdb_ip_address}}"
database_name: "{{influxdb_database_name}}"
policy_name: test
duration: 1w
replication: 1
- name: Create infinite retention policy
community.general.influxdb_retention_policy:
hostname: "{{influxdb_ip_address}}"
database_name: "{{influxdb_database_name}}"
policy_name: test
duration: INF
replication: 1
ssl: no
validate_certs: no
Authors¶
Kamil Szczygiel (@kamsz)