diff options
Diffstat (limited to 'tasks/plugins.yml')
-rw-r--r-- | tasks/plugins.yml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tasks/plugins.yml b/tasks/plugins.yml index 84f3d49..c03bca7 100644 --- a/tasks/plugins.yml +++ b/tasks/plugins.yml | |||
@@ -9,8 +9,8 @@ | |||
9 | 9 | ||
10 | - name: Setup plugin | 10 | - name: Setup plugin |
11 | uri: | 11 | uri: |
12 | url: "{{ kong_app_admin_url }}/{{ (current_config.id == '') | ternary('services/' ~ kong_app_service_name ~ '/plugins','plugins/' ~ current_config.id) }}" | 12 | url: "{{ kong_app_admin_url }}/{{ exists_plugin | ternary('services/' ~ kong_app_service_name ~ '/plugins','plugins/' ~ current_config.id) }}" |
13 | method: "{{ (current_config.id == '') | ternary ('POST', 'PATCH') }}" | 13 | method: "{{ exists_plugin | ternary ('POST', 'PATCH') }}" |
14 | body: "{{ plugin | combine(current_body) | to_json }}" | 14 | body: "{{ plugin | combine(current_body) | to_json }}" |
15 | headers: | 15 | headers: |
16 | apikey: "{{ kong_app_admin_apikey }}" | 16 | apikey: "{{ kong_app_admin_apikey }}" |
@@ -24,3 +24,5 @@ | |||
24 | current_id_hash: | 24 | current_id_hash: |
25 | id: "{{ current_config.id }}" | 25 | id: "{{ current_config.id }}" |
26 | current_body: "{{ (current_id_hash.id == '') | ternary({}, current_id_hash) }}" | 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 | ||