Bertrand Lallau bb1b0857b3 Grafana post_config checks only need to run locally
Recently added post_config for Grafana does some uri queries,
these can be problematic if run across every node.

Change-Id: I580212474879da18780fc5f66a21952a9e6f8daa
2017-06-02 21:30:51 +00:00

24 lines
796 B
YAML

---
- name: Wait for grafana port
wait_for:
host: "{{ api_interface_address }}"
port: "{{ grafana_server_port }}"
- name: Enable influxdb datasource
uri:
url: "{{ internal_protocol }}://{{ kolla_internal_vip_address }}:{{ grafana_server_port }}/api/datasources"
method: POST
user: admin
password: "{{ grafana_admin_password }}"
body: "{{ grafana_data_source | to_json }}"
body_format: json
force_basic_auth: yes
status_code: 200, 409
register: response
run_once: True
connection: local
when: grafana_data_source is defined
changed_when: response.status == 200
failed_when: response.status not in [200, 409] or
response.status == 409 and ("Data source with same name already exists" not in response.json.message|default(""))