labels, some cleanup

This commit is contained in:
2021-06-22 17:17:11 +02:00
parent 1f4dfe1821
commit c35dc25c39
5 changed files with 39 additions and 32 deletions

View File

@@ -23,11 +23,11 @@
cleanup: True
networks_cli_compatible: True
- add_host:
- name: add ansible connection to influxdb container
add_host:
name: ed-influxdb
ansible_connection: docker
# ansible_docker_extra_args: "-H=ssh://ed-c7-1.virt.magni.thoto.net" # FIXME
ansible_docker_extra_args: "-H=ssh://{{ansible_host}}" # FIXME
ansible_docker_extra_args: "-H=ssh://{{ansible_host}}"
changed_when: False
- name: wait for influx to run
@@ -35,32 +35,33 @@
changed_when: False
delegate_to: ed-influxdb
- name: fetch auth token
- name: fetch influxdb auth token
raw: influx auth list --user my-user --hide-headers --json
register: influx_token_fetch
changed_when: False
delegate_to: ed-influxdb
- name: set admin token
- name: set influxdb admin token
set_fact:
influx_admin_token:
"{{(influx_token_fetch.stdout | from_json | first).token}}"
- name: create bucket for cobald
- name: create influxdb bucket for cobald
influx_bucket:
base: "http://localhost:{{influx_pubport}}"
org: "my-org"
auth_token: "{{influx_admin_token}}"
name: "{{influx_bucket}}"
- name: create dashboard
- name: create influxdb dashboard
influx_dashboard:
base: "http://localhost:{{influx_pubport}}"
org: "my-org"
auth_token: "{{influx_admin_token}}"
data: "{{lookup('file', 'influxdb-dashboard-cobald.json')}}"
when: influxdb_dashboard | default(True)
- name: create token for telegraf
- name: create influxdb write access token for telegraf
influx_token:
base: "http://localhost:{{influx_pubport}}"
org: "my-org"