diff options
author | Gaƫtan <36162164+gaetanfl@users.noreply.github.com> | 2018-04-27 10:23:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-27 10:23:37 +0200 |
commit | 03d5555b42e25dd6da9a0241e8a5f5937a9bbeb8 (patch) | |
tree | e3c6dd93646e92aa0a4add3ff7d0c26672b5378e /tasks/routes.yml | |
parent | 72627c8c7454feb4ee38f2d3eddd4cfcabb9a2d4 (diff) | |
parent | 0d2ed34fe00b39a725c7bc82f898305187fd42b2 (diff) | |
download | ansible-kong-app-03d5555b42e25dd6da9a0241e8a5f5937a9bbeb8.tar.gz ansible-kong-app-03d5555b42e25dd6da9a0241e8a5f5937a9bbeb8.tar.zst ansible-kong-app-03d5555b42e25dd6da9a0241e8a5f5937a9bbeb8.zip |
Merge pull request #3 from gaetanfl/multiplekong_serversv0.3
support multiple kong servers
Diffstat (limited to 'tasks/routes.yml')
-rw-r--r-- | tasks/routes.yml | 12 |
1 files changed, 6 insertions, 6 deletions
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 @@ | |||
1 | - name: Get app routes | 1 | - name: Get app routes |
2 | uri: | 2 | uri: |
3 | url: "{{ kong_app_admin_url }}/services/{{ service.name }}/routes" | 3 | url: "{{ server.kong_app_admin_url }}/services/{{ service.name }}/routes" |
4 | method: GET | 4 | method: GET |
5 | validate_certs: no | 5 | validate_certs: no |
6 | headers: | 6 | headers: |
7 | apikey: "{{ kong_app_admin_apikey }}" | 7 | apikey: "{{ server.kong_app_admin_apikey }}" |
8 | register: kong_app_service_routes_check | 8 | register: kong_app_service_routes_check |
9 | 9 | ||
10 | - name: Setup route | 10 | - name: Setup route |
11 | uri: | 11 | uri: |
12 | url: "{{ kong_app_admin_url }}/services/{{ service.name }}/routes" | 12 | url: "{{ server.kong_app_admin_url }}/services/{{ service.name }}/routes" |
13 | method: POST | 13 | method: POST |
14 | body: "{{ route | to_json }}" | 14 | body: "{{ route | to_json }}" |
15 | headers: | 15 | headers: |
16 | apikey: "{{ kong_app_admin_apikey }}" | 16 | apikey: "{{ server.kong_app_admin_apikey }}" |
17 | Content-Type: application/json | 17 | Content-Type: application/json |
18 | status_code: 201 | 18 | status_code: 201 |
19 | with_items: "{{ service.routes | default([]) }}" | 19 | with_items: "{{ service.routes | default([]) }}" |
@@ -22,10 +22,10 @@ | |||
22 | 22 | ||
23 | - name: Delete old routes | 23 | - name: Delete old routes |
24 | uri: | 24 | uri: |
25 | url: "{{ kong_app_admin_url }}/routes/{{ item.id }}" | 25 | url: "{{ server.kong_app_admin_url }}/routes/{{ item.id }}" |
26 | method: DELETE | 26 | method: DELETE |
27 | headers: | 27 | headers: |
28 | apikey: "{{ kong_app_admin_apikey }}" | 28 | apikey: "{{ server.kong_app_admin_apikey }}" |
29 | status_code: 204 | 29 | status_code: 204 |
30 | with_items: "{{ kong_app_service_routes_check.json.data }}" | 30 | with_items: "{{ kong_app_service_routes_check.json.data }}" |
31 | when: not kong_app_service_routes_check is skipped | 31 | when: not kong_app_service_routes_check is skipped |