]> 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 4581e8c131e3cccf6db45beab0d1092e015893f7..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