aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/kong-app.yml
blob: 3c51e7e3092a351341657864f66fc9c9e1a04cba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
- name: Upstream Creation
  import_tasks: upstream.yml
  when: service.upstream is defined

# https://docs.konghq.com/2.1.x/admin-api/#update-or-create-service
- name: Update or Create service
  uri:
    url: "{{ server.kong_app_admin_url }}/services/{{ service.name }}"
    method: PUT
    body: "{{ service_body | to_json }}"
    status_code: 200,201
    headers:
      apikey: "{{ server.kong_app_admin_apikey }}"
      Content-Type: application/json
  vars:
    service_body:
      name: "{{ service.name }}"
      url: "{{ service.url }}"

- name: Setup plugins
  import_tasks: plugins.yml

- name: Setup routes
  import_tasks: routes.yml