From 507bb99c0f6c79d5257d293a5eda6bbd3e34caaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Duchaussois?= Date: Thu, 26 Apr 2018 18:15:47 +0200 Subject: support multiple kong servers --- tasks/routes.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tasks/routes.yml') diff --git a/tasks/routes.yml b/tasks/routes.yml index 881fc96..3ff2507 100644 --- a/tasks/routes.yml +++ b/tasks/routes.yml @@ -1,19 +1,19 @@ - name: Get app routes uri: - url: "{{ kong_app_admin_url }}/services/{{ service.name }}/routes" + url: "{{ server.kong_app_admin_url }}/services/{{ service.name }}/routes" method: GET validate_certs: no headers: - apikey: "{{ kong_app_admin_apikey }}" + apikey: "{{ server.kong_app_admin_apikey }}" register: kong_app_service_routes_check - name: Setup route uri: - url: "{{ kong_app_admin_url }}/services/{{ service.name }}/routes" + url: "{{ server.kong_app_admin_url }}/services/{{ service.name }}/routes" method: POST body: "{{ route | to_json }}" headers: - apikey: "{{ kong_app_admin_apikey }}" + apikey: "{{ server.kong_app_admin_apikey }}" Content-Type: application/json status_code: 201 with_items: "{{ service.routes | default([]) }}" @@ -22,10 +22,10 @@ - name: Delete old routes uri: - url: "{{ kong_app_admin_url }}/routes/{{ item.id }}" + url: "{{ server.kong_app_admin_url }}/routes/{{ item.id }}" method: DELETE headers: - apikey: "{{ kong_app_admin_apikey }}" + apikey: "{{ server.kong_app_admin_apikey }}" status_code: 204 with_items: "{{ kong_app_service_routes_check.json.data }}" when: not kong_app_service_routes_check is skipped -- cgit v1.2.3