aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/routes.yml
diff options
context:
space:
mode:
Diffstat (limited to 'tasks/routes.yml')
-rw-r--r--tasks/routes.yml10
1 files changed, 4 insertions, 6 deletions
diff --git a/tasks/routes.yml b/tasks/routes.yml
index 1a9f6db..bbcdb76 100644
--- a/tasks/routes.yml
+++ b/tasks/routes.yml
@@ -3,12 +3,10 @@
3 url: "{{ kong_app_admin_url }}/services/{{ kong_app_service_name }}/routes" 3 url: "{{ kong_app_admin_url }}/services/{{ kong_app_service_name }}/routes"
4 method: GET 4 method: GET
5 validate_certs: no 5 validate_certs: no
6 headers:
7 apikey: "{{ kong_app_admin_apikey }}"
6 register: kong_app_service_routes_check 8 register: kong_app_service_routes_check
7 9
8- name: Set routes facts
9 set_fact:
10 kong_app_current_routes: "{{ kong_app_service_routes_check.json |default('{\"data\": []}') | from_json }}"
11
12- name: Setup route 10- name: Setup route
13 uri: 11 uri:
14 url: "{{ kong_app_admin_url }}/services/{{ kong_app_service_name }}/routes" 12 url: "{{ kong_app_admin_url }}/services/{{ kong_app_service_name }}/routes"
@@ -24,9 +22,9 @@
24 22
25- name: Delete old routes 23- name: Delete old routes
26 uri: 24 uri:
27 url: "{{ kong_app_admin_url }}/services/routes/{{ item.id }}" 25 url: "{{ kong_app_admin_url }}/routes/{{ item.id }}"
28 method: DELETE 26 method: DELETE
29 headers: 27 headers:
30 apikey: "{{ kong_app_admin_apikey }}" 28 apikey: "{{ kong_app_admin_apikey }}"
31 status_code: 204 29 status_code: 204
32 with_items: "{{ kong_app_current_routes.data }}" 30 with_items: "{{ kong_app_service_routes_check.json.data }}"