53 lines
1.8 KiB
YAML
53 lines
1.8 KiB
YAML
---
|
|
# 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
|
|
ssl: yes
|
|
validate_certs: yes
|
|
user_name: "{{ monitoring_influxdb_admin_username }}"
|
|
user_password: "{{ monitoring_influxdb_admin_password }}"
|
|
admin: yes
|
|
delegate_to: 127.0.0.1
|
|
|
|
- name: Configure databases
|
|
include: database.yml
|
|
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
|
|
ssl: yes
|
|
validate_certs: yes
|
|
user_name: "{{ item.username }}"
|
|
user_password: "{{ item.password }}"
|
|
grants: "{{ item.grants }}"
|
|
loop: "{{ monitoring_influxdb_users }}"
|
|
delegate_to: 127.0.0.1
|