aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/kong-app.yml
diff options
context:
space:
mode:
authorGaƫtan <36162164+gaetanfl@users.noreply.github.com>2018-04-27 10:23:37 +0200
committerGitHub <noreply@github.com>2018-04-27 10:23:37 +0200
commit03d5555b42e25dd6da9a0241e8a5f5937a9bbeb8 (patch)
treee3c6dd93646e92aa0a4add3ff7d0c26672b5378e /tasks/kong-app.yml
parent72627c8c7454feb4ee38f2d3eddd4cfcabb9a2d4 (diff)
parent0d2ed34fe00b39a725c7bc82f898305187fd42b2 (diff)
downloadansible-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/kong-app.yml')
-rw-r--r--tasks/kong-app.yml8
1 files changed, 4 insertions, 4 deletions
diff --git a/tasks/kong-app.yml b/tasks/kong-app.yml
index f94f044..bff2f46 100644
--- a/tasks/kong-app.yml
+++ b/tasks/kong-app.yml
@@ -1,20 +1,20 @@
1- name: Check if service exists 1- name: Check if service exists
2 uri: 2 uri:
3 url: "{{ kong_app_admin_url }}/services/{{ service.name }}" 3 url: "{{ server.kong_app_admin_url }}/services/{{ service.name }}"
4 method: GET 4 method: GET
5 headers: 5 headers:
6 apikey: "{{ kong_app_admin_apikey }}" 6 apikey: "{{ server.kong_app_admin_apikey }}"
7 status_code: 200,404 7 status_code: 200,404
8 register: kong_app_check_service 8 register: kong_app_check_service
9 9
10- name: Update or Create service 10- name: Update or Create service
11 uri: 11 uri:
12 url: "{{ kong_app_admin_url }}/services/{{ exists_service | ternary('', service.name) }}" 12 url: "{{ server.kong_app_admin_url }}/services/{{ exists_service | ternary('', service.name) }}"
13 method: "{{ exists_service | ternary('POST', 'PATCH') }}" 13 method: "{{ exists_service | ternary('POST', 'PATCH') }}"
14 body: "{{ service_body | to_json }}" 14 body: "{{ service_body | to_json }}"
15 status_code: 200,201 15 status_code: 200,201
16 headers: 16 headers:
17 apikey: "{{ kong_app_admin_apikey }}" 17 apikey: "{{ server.kong_app_admin_apikey }}"
18 Content-Type: application/json 18 Content-Type: application/json
19 vars: 19 vars:
20 exists_service: "{{ kong_app_check_service.status|default(404) == 404 }}" 20 exists_service: "{{ kong_app_check_service.status|default(404) == 404 }}"