infrastructure/roles/monitoring/tasks/influxdb/main.yml

56 lines
1.8 KiB
YAML
Raw Normal View History

2020-08-10 01:37:13 +02:00
---
# Task file influxdb/main.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 admin user
influxdb_user:
state: present
login_username: "{{ monitoring_influxdb_admin_username }}"
login_password: "{{ monitoring_influxdb_admin_password }}"
hostname: "{{ monitoring_influxdb_domain }}"
port: 443
2021-03-05 13:02:55 +01:00
ssl: true
validate_certs: true
2020-08-10 01:37:13 +02:00
user_name: "{{ monitoring_influxdb_admin_username }}"
user_password: "{{ monitoring_influxdb_admin_password }}"
2021-03-05 13:02:55 +01:00
admin: true
2020-08-10 01:37:13 +02:00
delegate_to: 127.0.0.1
2021-03-05 13:02:55 +01:00
no_log: true
2020-08-10 01:37:13 +02:00
- name: Configure databases
include_tasks: database.yml
2020-08-10 01:37:13 +02:00
loop: "{{ monitoring_influxdb_databases }}"
loop_control:
loop_var: "database"
- name: Create database user
influxdb_user:
state: present
login_username: "{{ monitoring_influxdb_admin_username }}"
login_password: "{{ monitoring_influxdb_admin_password }}"
hostname: "{{ monitoring_influxdb_domain }}"
port: 443
2021-03-05 13:02:55 +01:00
ssl: true
validate_certs: true
2020-08-10 01:37:13 +02:00
user_name: "{{ item.username }}"
user_password: "{{ item.password }}"
grants: "{{ item.grants }}"
loop: "{{ monitoring_influxdb_users }}"
delegate_to: 127.0.0.1
2021-03-05 13:02:55 +01:00
no_log: true