]> git.immae.eu Git - github/fretlink/ansible-kong-app.git/blobdiff - tasks/routes.yml
setup an array of services
[github/fretlink/ansible-kong-app.git] / tasks / routes.yml
index d4d912fdbd24b3ed1d1ac447f5066c934cba77ae..881fc9626656df4a92b020a97fdd11a88500beea 100644 (file)
@@ -1,6 +1,6 @@
 - name: Get app routes
   uri:
-    url: "{{ kong_app_admin_url }}/services/{{ kong_app_service_name }}/routes"
+    url: "{{ kong_app_admin_url }}/services/{{ service.name }}/routes"
     method: GET
     validate_certs: no
     headers:
@@ -9,14 +9,14 @@
 
 - name: Setup route
   uri:
-    url: "{{ kong_app_admin_url }}/services/{{ kong_app_service_name }}/routes"
+    url: "{{ kong_app_admin_url }}/services/{{ service.name }}/routes"
     method: POST
     body: "{{ route | to_json }}"
     headers:
       apikey: "{{ kong_app_admin_apikey }}"
       Content-Type: application/json
     status_code: 201
-  with_items: "{{ kong_app_routes }}"
+  with_items: "{{ service.routes | default([]) }}"
   loop_control:
     loop_var: route
 
@@ -28,4 +28,4 @@
       apikey: "{{ kong_app_admin_apikey }}"
     status_code: 204
   with_items: "{{ kong_app_service_routes_check.json.data }}"
-  when: not kong_app_service_routes_check|skipped
+  when: not kong_app_service_routes_check is skipped