diff options
author | Gaëtan Duchaussois <gaetan.duchaussois@fretlink.com> | 2019-04-04 10:57:21 +0200 |
---|---|---|
committer | Gaëtan Duchaussois <gaetan.duchaussois@fretlink.com> | 2019-04-04 10:57:21 +0200 |
commit | ee9d9303c8ebc9d82b4892e702c8bfc2a0316cdb (patch) | |
tree | 9599e58eeab2e3f3822ed564afb6a6476c3de071 | |
parent | 82f8f46f073e171a0dd3b226a97b8df935ce58be (diff) | |
download | ansible-kong-app-ee9d9303c8ebc9d82b4892e702c8bfc2a0316cdb.tar.gz ansible-kong-app-ee9d9303c8ebc9d82b4892e702c8bfc2a0316cdb.tar.zst ansible-kong-app-ee9d9303c8ebc9d82b4892e702c8bfc2a0316cdb.zip |
debug
-rw-r--r-- | tasks/plugins.yml | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tasks/plugins.yml b/tasks/plugins.yml index 3b105ae..e0eee81 100644 --- a/tasks/plugins.yml +++ b/tasks/plugins.yml | |||
@@ -7,6 +7,23 @@ | |||
7 | apikey: "{{ server.kong_app_admin_apikey }}" | 7 | apikey: "{{ server.kong_app_admin_apikey }}" |
8 | register: kong_app_service_plugins_check | 8 | register: kong_app_service_plugins_check |
9 | 9 | ||
10 | - name: debug | ||
11 | debug: | ||
12 | var: kong_app_service_plugins_check | ||
13 | |||
14 | - name: debug2 | ||
15 | debug: | ||
16 | var: current_body | ||
17 | vars: | ||
18 | current_config: "{{ kong_app_service_plugins_check.json.data | selectattr('name', 'equalto', plugin.name) | first |default({\"id\": ''}) }}" | ||
19 | current_id_hash: | ||
20 | id: "{{ current_config.id }}" | ||
21 | current_body: "{{ (current_id_hash.id == '') | ternary({}, current_id_hash) }}" | ||
22 | exists_plugin: "{{ current_id_hash.id == '' }}" | ||
23 | with_items: "{{ service.plugins | default([]) }}" | ||
24 | loop_control: | ||
25 | loop_var: plugin | ||
26 | |||
10 | - name: Setup plugin | 27 | - name: Setup plugin |
11 | uri: | 28 | uri: |
12 | url: "{{ server.kong_app_admin_url }}/{{ exists_plugin | ternary('services/' ~ service.name ~ '/plugins','plugins/' ~ current_config.id) }}" | 29 | url: "{{ server.kong_app_admin_url }}/{{ exists_plugin | ternary('services/' ~ service.name ~ '/plugins','plugins/' ~ current_config.id) }}" |