Created
March 2, 2017 22:32
-
-
Save mrtyler/25218e61e1b0eec06d0b58accf4ba3af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This part appears to work. It returns json. | |
- name: Check if influxdb datasource configured | |
uri: | |
method: GET | |
user: "{{ grafana_admin_login|quote }}" | |
password: "{{ grafana_admin_password|quote }}" | |
force_basic_auth: true | |
body_format: json | |
url: "http://localhost:{{ grafana_port }}/api/datasources" | |
register: datasources | |
- name: Configure influxdb datasource | |
uri: | |
method: POST | |
user: "{{ grafana_admin_login|quote }}" | |
password: "{{ grafana_admin_password|quote }}" | |
force_basic_auth: true | |
body_format: json | |
body: { | |
} | |
url: "http://localhost:{{ grafana_port }}/api/datasources" | |
# when: "\"type\": \"influxdb\" not in datasources.json" | |
when: "{{ influxdb_datasource|to_json }} not in datasources.json" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment