瀏覽代碼

Dont fail when datasource or dashboard already exists

Mateus Caruccio 6 年之前
父節點
當前提交
c5bd0cb421
共有 1 個文件被更改,包括 9 次插入0 次删除
  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
     method: POST
     body: '{{ payload_data }}'
     body: '{{ payload_data }}'
     body_format: json
     body_format: json
+    status_code:
+    - 200
+    - 409
     headers:
     headers:
       Content-Type: "Content-Type: application/json"
       Content-Type: "Content-Type: application/json"
   register: add_ds
   register: add_ds
@@ -221,6 +224,9 @@
     method: POST
     method: POST
     body: '{{ slurpfile["content"] | b64decode }}'
     body: '{{ slurpfile["content"] | b64decode }}'
     body_format: json
     body_format: json
+    status_code:
+    - 200
+    - 412
     headers:
     headers:
       Content-Type: "Content-Type: application/json"
       Content-Type: "Content-Type: application/json"
   register: add_ds
   register: add_ds
@@ -238,6 +244,9 @@
     method: POST
     method: POST
     body: '{{ slurpfile["content"] | b64decode }}'
     body: '{{ slurpfile["content"] | b64decode }}'
     body_format: json
     body_format: json
+    status_code:
+    - 200
+    - 412
     headers:
     headers:
       Content-Type: "Content-Type: application/json"
       Content-Type: "Content-Type: application/json"
   register: add_ds
   register: add_ds