community.general.influxdb_retention_policy – Manage InfluxDB retention policies¶
Note
This plugin is part of the community.general collection (version 2.5.1).
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 with 1 hour shard group duration
community.general.influxdb_retention_policy:
hostname: "{{influxdb_ip_address}}"
database_name: "{{influxdb_database_name}}"
policy_name: test
duration: 1d
replication: 1
shard_group_duration: 1h
- name: Create 1 week retention policy with 1 day shard group duration
community.general.influxdb_retention_policy:
hostname: "{{influxdb_ip_address}}"
database_name: "{{influxdb_database_name}}"
policy_name: test
duration: 1w
replication: 1
shard_group_duration: 1d
- name: Create infinite retention policy with 1 week of shard group duration
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
shard_group_duration: 1w
Authors¶
Kamil Szczygiel (@kamsz)