]> git.immae.eu Git - github/fretlink/ansible-kong-app.git/blob - tasks/kong-app.yml
Use PUT methods instead of manually detecting if new or update
[github/fretlink/ansible-kong-app.git] / tasks / kong-app.yml
1 - name: Upstream Creation
2 import_tasks: upstream.yml
3 when: service.upstream is defined
4
5 # https://docs.konghq.com/2.1.x/admin-api/#update-or-create-service
6 - name: Update or Create service
7 uri:
8 url: "{{ server.kong_app_admin_url }}/services/{{ service.name }}"
9 method: PUT
10 body: "{{ service_body | to_json }}"
11 status_code: 200,201
12 headers:
13 apikey: "{{ server.kong_app_admin_apikey }}"
14 Content-Type: application/json
15 vars:
16 service_body:
17 name: "{{ service.name }}"
18 url: "{{ service.url }}"
19
20 - name: Setup plugins
21 import_tasks: plugins.yml
22
23 - name: Setup routes
24 import_tasks: routes.yml