Browse Source

Dont fail when datasource or dashboard already exists

Mateus Caruccio 6 years ago
parent
commit
c5bd0cb421
1 changed files with 9 additions and 0 deletions
  1. 9 0
      roles/openshift_grafana/tasks/install_grafana.yaml

+ 9 - 0
roles/openshift_grafana/tasks/install_grafana.yaml

@@ -175,6 +175,9 @@
     method: POST
     body: '{{ payload_data }}'
     body_format: json
+    status_code:
+    - 200
+    - 409
     headers:
       Content-Type: "Content-Type: application/json"
   register: add_ds
@@ -221,6 +224,9 @@
     method: POST
     body: '{{ slurpfile["content"] | b64decode }}'
     body_format: json
+    status_code:
+    - 200
+    - 412
     headers:
       Content-Type: "Content-Type: application/json"
   register: add_ds
@@ -238,6 +244,9 @@
     method: POST
     body: '{{ slurpfile["content"] | b64decode }}'
     body_format: json
+    status_code:
+    - 200
+    - 412
     headers:
       Content-Type: "Content-Type: application/json"
   register: add_ds