3 url: "{{ kong_app_admin_url }}/services/{{ kong_app_service_name }}/plugins"
7 apikey: "{{ kong_app_admin_apikey }}"
8 register: kong_app_service_plugins_check
12 url: "{{ kong_app_admin_url }}/{{ exists_plugin | ternary('services/' ~ kong_app_service_name ~ '/plugins','plugins/' ~ current_config.id) }}"
13 method: "{{ exists_plugin | ternary ('POST', 'PATCH') }}"
14 body: "{{ plugin | combine(current_body) | to_json }}"
16 apikey: "{{ kong_app_admin_apikey }}"
17 Content-Type: application/json
19 with_items: "{{ kong_app_plugins }}"
23 current_config: "{{ kong_app_service_plugins_check.json.data | selectattr('name', 'equalto', plugin.name) | first |default({\"id\": ''}) }}"
25 id: "{{ current_config.id }}"
26 current_body: "{{ (current_id_hash.id == '') | ternary({}, current_id_hash) }}"
27 exists_plugin: "{{ current_id_hash.id == '' }}"
28 when: not kong_app_service_plugins_check|skipped