]>
Commit | Line | Data |
---|---|---|
1a33ca31 GD |
1 | - name: Get app routes |
2 | uri: | |
507bb99c | 3 | url: "{{ server.kong_app_admin_url }}/services/{{ service.name }}/routes" |
1a33ca31 GD |
4 | method: GET |
5 | validate_certs: no | |
ad5e125a | 6 | headers: |
507bb99c | 7 | apikey: "{{ server.kong_app_admin_apikey }}" |
1a33ca31 GD |
8 | register: kong_app_service_routes_check |
9 | ||
1a33ca31 GD |
10 | - name: Setup route |
11 | uri: | |
507bb99c | 12 | url: "{{ server.kong_app_admin_url }}/services/{{ service.name }}/routes" |
1a33ca31 GD |
13 | method: POST |
14 | body: "{{ route | to_json }}" | |
15 | headers: | |
507bb99c | 16 | apikey: "{{ server.kong_app_admin_apikey }}" |
1a33ca31 GD |
17 | Content-Type: application/json |
18 | status_code: 201 | |
767c0e53 | 19 | with_items: "{{ service.routes | default([]) }}" |
1a33ca31 GD |
20 | loop_control: |
21 | loop_var: route | |
22 | ||
23 | - name: Delete old routes | |
24 | uri: | |
507bb99c | 25 | url: "{{ server.kong_app_admin_url }}/routes/{{ item.id }}" |
1a33ca31 GD |
26 | method: DELETE |
27 | headers: | |
507bb99c | 28 | apikey: "{{ server.kong_app_admin_apikey }}" |
1a33ca31 | 29 | status_code: 204 |
ad5e125a | 30 | with_items: "{{ kong_app_service_routes_check.json.data }}" |
0682b865 | 31 | when: not kong_app_service_routes_check is skipped |