demo.yml 614 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
---
- name: Check to see which databases already exist
  command: /opt/influxdb/influx -execute 'show databases'
  register: db_listing

- name: Create demo database
  command: /opt/influxdb/influx -execute 'CREATE DATABASE {{ sample_database_name }}'
  when: db_listing.stdout.find("my_sample_db") == -1

- name: Load demo data
  uri:
    url: http://localhost:8086/write?db={{ sample_database_name }}
    method: POST
    body: "{{ sample_measurement_name }},host=server_{{ 10 | random }},az=US{{ 5 | random }} value={{ 100 | random }}"
    status_code: 204
  with_sequence: start=1 end={{ sample_num_points }}