From: paulrbr-fl <43074087+paulrbr-fl@users.noreply.github.com> Date: Thu, 4 Apr 2019 11:40:09 +0000 (+0200) Subject: Merge pull request #10 from paulrbr-fl/fix-dhall-config-for-kong-upgrade X-Git-Tag: v0.6 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=f3304d462d69fbd1466172c3c7cf445eed19f25f;hp=66401fc939cd73628561d4832c3e219f0b44d8de;p=github%2Ffretlink%2Fansible-kong-app.git Merge pull request #10 from paulrbr-fl/fix-dhall-config-for-kong-upgrade dhall(fix): fix for generated configuration for Kong 1.x upgrade --- diff --git a/dhall/server/service/plugin/Config.dhall b/dhall/server/service/plugin/Config.dhall index 73a333f..d54436b 100644 --- a/dhall/server/service/plugin/Config.dhall +++ b/dhall/server/service/plugin/Config.dhall @@ -1,9 +1,9 @@ < CorrelationId : - { header_name : Text, echo_downstream : Bool } + { header_name : Text, echo_downstream : Bool } | RequestTransformer : - { `add.headers` : Text } + { add : { headers : List Text } } | RequestTermination : - { status_code : Natural, content_type : Text, body : Text } + { status_code : Natural, content_type : Text, body : Text } | IPRestriction : - { whitelist : Text } -> + { whitelist : Text } +> \ No newline at end of file diff --git a/dhall/server/service/plugin/mkRequestTransformer.dhall b/dhall/server/service/plugin/mkRequestTransformer.dhall index 90789c8..1d8d608 100644 --- a/dhall/server/service/plugin/mkRequestTransformer.dhall +++ b/dhall/server/service/plugin/mkRequestTransformer.dhall @@ -1,11 +1,11 @@ - let Plugin = ./Plugin.dhall +let Plugin = ./Plugin.dhall in let config = constructors ./Config.dhall -in λ(header : Text) - → { name = - "request-transformer" - , config = - config.RequestTransformer { `add.headers` = header } - } - : Plugin + in λ(header : Text) + → { name = + "request-transformer" + , config = + config.RequestTransformer { add = { headers = [ header ] } } + } + : Plugin \ No newline at end of file diff --git a/meta/main.yml b/meta/main.yml index a2ae975..af8b3f0 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -32,7 +32,13 @@ galaxy_info: # # platforms is a list of platforms, and each platform has a name and a list of versions. # - # platforms: + platforms: + - name: Debian + versions: + - all + - name: Ubuntu + version: + - all # - name: Fedora # versions: # - all diff --git a/tasks/plugins.yml b/tasks/plugins.yml index cedbbd2..c64e5c9 100644 --- a/tasks/plugins.yml +++ b/tasks/plugins.yml @@ -23,7 +23,7 @@ current_config: "{{ kong_app_service_plugins_check.json.data | selectattr('name', 'equalto', plugin.name) | first |default({\"id\": ''}) }}" current_id_hash: id: "{{ current_config.id }}" - current_body: "{{ (current_id_hash.id == '') | ternary({}, current_id_hash) }}" - exists_plugin: "{{ current_id_hash.id == '' }}" + current_body: "{{ not current_id_hash.id | ternary({}, current_id_hash) }}" + exists_plugin: "{{ not current_id_hash.id }}" when: not kong_app_service_plugins_check is skipped no_log: true