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

@@ -1,4 +1,5 @@
- file:
- name: setup directories for telegraf
file:
path: "/container/{{item}}/telegraf/"
state: directory
owner: "{{unpriv_user}}"
@@ -7,14 +8,16 @@
- docker-images
- volumes
- copy:
- name: copy telegraf Dockerfile
copy:
src: telegraf.Dockerfile
dest: /container/docker-images/telegraf/Dockerfile
owner: "{{unpriv_user}}"
group: docker
register: cobald_cp_telegraf_dockerfile
- copy: # telegraf is found in influxdb repo
- name: copy telegraf repo file
copy: # telegraf is found in influxdb repo
src: influxdb.repo
dest: /container/docker-images/telegraf/influxdb.repo
owner: "{{unpriv_user}}"
@@ -29,20 +32,9 @@
source: build
force_source: "{{cobald_cp_telegraf_dockerfile.changed}}"
- set_fact:
influx_hostname: "ed-influxdb"
influx_domainname: "cobald.local"
influx_bucket: batleth
tags: influxdb
- import_tasks: influxdb.yml
tags: influxdb
- set_fact:
# influx_url: "http://{{influx_hostname}}.{{influx_domainname}}:8086"
influx_url: "http://{{influx_hostname}}:8086"
tags: influxdb
- name: generate telegraf config
template:
src: telegraf.conf.j2
@@ -51,6 +43,7 @@
group: docker
vars:
influx_token: "{{influx_telegraf_token.token}}"
influx_url: "http://{{influx_hostname}}:8086"
register: telegraf_config_gen
- name: run telegraf container
@@ -70,4 +63,6 @@
networks_cli_compatible: True
- import_tasks: grafana.yml
vars:
influx_url: "http://{{influx_hostname}}:8086"
tags: influxdb