]> git.immae.eu Git - github/fretlink/ansible-kong-app.git/blob - tasks/routes.yml
fix deprecation warning
[github/fretlink/ansible-kong-app.git] / tasks / routes.yml
1 - name: Get app routes
2 uri:
3 url: "{{ kong_app_admin_url }}/services/{{ kong_app_service_name }}/routes"
4 method: GET
5 validate_certs: no
6 headers:
7 apikey: "{{ kong_app_admin_apikey }}"
8 register: kong_app_service_routes_check
9
10 - name: Setup route
11 uri:
12 url: "{{ kong_app_admin_url }}/services/{{ kong_app_service_name }}/routes"
13 method: POST
14 body: "{{ route | to_json }}"
15 headers:
16 apikey: "{{ kong_app_admin_apikey }}"
17 Content-Type: application/json
18 status_code: 201
19 with_items: "{{ kong_app_routes }}"
20 loop_control:
21 loop_var: route
22
23 - name: Delete old routes
24 uri:
25 url: "{{ kong_app_admin_url }}/routes/{{ item.id }}"
26 method: DELETE
27 headers:
28 apikey: "{{ kong_app_admin_apikey }}"
29 status_code: 204
30 with_items: "{{ kong_app_service_routes_check.json.data }}"
31 when: not kong_app_service_routes_check is skipped