]> git.immae.eu Git - github/fretlink/ansible-kong-app.git/blobdiff - tasks/plugins.yml
setup an array of services
[github/fretlink/ansible-kong-app.git] / tasks / plugins.yml
index f096d4b717ff0c8cfafb1f60e5ec7af606d1d7ab..3ae0fbefd29bbe539df6d8dd167cc4b8a1e27123 100644 (file)
@@ -1,6 +1,6 @@
 - name: Get plugins
   uri:
-    url: "{{ kong_app_admin_url }}/services/{{ kong_app_service_name }}/plugins"
+    url: "{{ kong_app_admin_url }}/services/{{ service.name }}/plugins"
     method: GET
     validate_certs: no
     headers:
@@ -9,14 +9,14 @@
 
 - name: Setup plugin
   uri:
-    url: "{{ kong_app_admin_url }}/{{ exists_plugin | ternary('services/' ~ kong_app_service_name ~ '/plugins','plugins/' ~ current_config.id) }}"
+    url: "{{ kong_app_admin_url }}/{{ exists_plugin | ternary('services/' ~ service.name ~ '/plugins','plugins/' ~ current_config.id) }}"
     method: "{{ exists_plugin | ternary ('POST', 'PATCH') }}"
     body: "{{ plugin | combine(current_body)  | to_json }}"
     headers:
       apikey: "{{ kong_app_admin_apikey }}"
       Content-Type: application/json
     status_code: 200,201
-  with_items: "{{ kong_app_plugins }}"
+  with_items: "{{ service.plugins | default([]) }}"
   loop_control:
     loop_var: plugin
   vars: