infrastructure/roles/monitoring/tasks/influxdb/database.yml
2021-03-05 13:02:55 +01:00

49 lines
1.7 KiB
YAML

---
# Task file influxdb/database.yml for the monitoring role
# Infrastructure
# Ansible instructions to deploy the infrastructure
# Copyright (C) 2019-2020 Christoph (Sheogorath) Kern
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
- name: Create database
influxdb_database:
state: present
login_username: "{{ monitoring_influxdb_admin_username }}"
login_password: "{{ monitoring_influxdb_admin_password }}"
hostname: "{{ monitoring_influxdb_domain }}"
port: 443
ssl: true
validate_certs: true
database_name: "{{ database.name }}"
delegate_to: 127.0.0.1
no_log: true
- name: Create retention policies
influxdb_retention_policy:
login_username: "{{ monitoring_influxdb_admin_username }}"
login_password: "{{ monitoring_influxdb_admin_password }}"
hostname: "{{ monitoring_influxdb_domain }}"
port: 443
ssl: true
validate_certs: true
database_name: "{{ database.name }}"
policy_name: "{{ policy.name }}"
duration: "{{ policy.duration }}"
replication: "{{ policy.replication }}"
default: "{{ policy.default | default(omit) }}"
loop: "{{ database.policies }}"
loop_control:
loop_var: "policy"
delegate_to: 127.0.0.1