]> git.immae.eu Git - github/fretlink/ansible-kong-app.git/blame - 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
CommitLineData
fb5b4527
GD
1- name: Upstream Creation
2 import_tasks: upstream.yml
3 when: service.upstream is defined
4
86fe1360 5# https://docs.konghq.com/2.1.x/admin-api/#update-or-create-service
ad5e125a
GD
6- name: Update or Create service
7 uri:
86fe1360
PB
8 url: "{{ server.kong_app_admin_url }}/services/{{ service.name }}"
9 method: PUT
767c0e53 10 body: "{{ service_body | to_json }}"
ad5e125a
GD
11 status_code: 200,201
12 headers:
507bb99c 13 apikey: "{{ server.kong_app_admin_apikey }}"
ad5e125a 14 Content-Type: application/json
d213edd1 15 vars:
767c0e53
GD
16 service_body:
17 name: "{{ service.name }}"
18 url: "{{ service.url }}"
1a33ca31
GD
19
20- name: Setup plugins
21 import_tasks: plugins.yml
22
23- name: Setup routes
24 import_tasks: routes.yml