Skip to content
Snippets Groups Projects
Commit c5d1e1d5 authored by Bartosz Zurkowski's avatar Bartosz Zurkowski
Browse files

Call Grafana APIs only once


In multinode deployments creating default Grafana organization failed,
because Ansible attempted to call Grafana API in the context of each
host in the inventory. After creating organization via the first host,
subsequent attempts via the remaining hosts failed due to already
existing organization. This change enforces creating default
organization only once.

Other tasks using Grafana API have been enforced to be ran only once as
well.

Change-Id: I3a93a719b3c9b4e55ab226d3b22d571d9a0f489d
Signed-off-by: default avatarBartosz Zurkowski <b.zurkowski@samsung.com>
parent 404d0b1c
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,7 @@
password: '{{ monasca_grafana_admin_password }}'
return_content: true
force_basic_auth: true
run_once: True
register: monasca_grafana_orgs
- name: Create default control plane organisation if it doesn't exist
......@@ -33,6 +34,7 @@
body:
name: '{{ monasca_grafana_control_plane_org }}'
force_basic_auth: true
run_once: True
when: monasca_grafana_control_plane_org not in monasca_grafana_orgs.json|map(attribute='name')|unique
- name: Lookup Monasca Grafana control plane organisation ID
......@@ -43,6 +45,7 @@
password: '{{ monasca_grafana_admin_password }}'
return_content: true
force_basic_auth: true
run_once: True
register: monasca_grafana_conf_org
- name: Add {{ monasca_grafana_admin_username }} user to control plane organisation
......@@ -70,6 +73,7 @@
user: '{{ monasca_grafana_admin_username }}'
password: '{{ monasca_grafana_admin_password }}'
force_basic_auth: true
run_once: True
- name: Enable Monasca Grafana datasource for control plane organisation
uri:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment