Skip to content

Influxdb

Auto Documentation

Documentation Generated with Python on 2021-04-03

Default Variables

Tasks

main.yml

- name: "[Docker] ensures Influxdb directory dir exists"
  file:
    path: "{{ item }}"
    state: directory
    owner: "{{ main_user}}"
    group: "{{ main_group }}"
  loop:
    - "{{ docker_dir }}/influxdb_data/"

- name: "[Docker] Create Docker Container"
  docker_container:
    name: influxdb
    image: influxdb:latest
    restart_policy: always
    networks:
      - name: web
        aliases: influxdb
    ports:
      - "8086:8086"
      - "8083:8083"
    mounts:
      - type: bind
        source: "{{ docker_dir }}/influxdb_data/"
        target: /var/lib/influxdb
    env:
      INFLUXDB_DB: "home_assistant"

- name: InfluxDB Create Database
  uri:
    url: http://{{ vm_ubnt_docker_ip }}:8086/query
    method: POST
    body: "q=CREATE DATABASE home_assistant"
    body_format: form-urlencoded

- name: InfluxDB Create Database
  uri:
    url: http://{{ vm_ubnt_docker_ip }}:8086/query
    method: POST
    body: "q=CREATE DATABASE glances"
    body_format: form-urlencoded