From f4f9e2fb047a0fd925054fd2ea48ec6453e5c220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Mass=C3=A9?= Date: Fri, 1 Mar 2019 15:03:35 +0100 Subject: [PATCH] explain how to deploy a custom policy chain --- CUSTOM.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CUSTOM.md b/CUSTOM.md index d896b6c..7d4a6ff 100644 --- a/CUSTOM.md +++ b/CUSTOM.md @@ -33,3 +33,28 @@ variable. - nmasse-itix.threescale-cicd ``` +## Provision a custom policy chain + +To provision a custom policy chain, you would need to store your custom policy +in a file and reference it from the `threescale_cicd_policies_to_update` variable. + +**custom-policy-chain.json**: + +```json +[ + { "name": "cors", "version": "builtin", "configuration": {}, "enabled": true }, + { "name": "headers", "version": "builtin", "configuration": { "request": [ { "op": "set", "header": "X-TEST", "value_type": "plain", "value": "foo" } ] }, "enabled": true }, + { "name": "apicast", "version": "builtin", "configuration": {}, "enabled": true } +] +``` + +**deploy-api.yaml**: + +```yaml +- hosts: threescale + gather_facts: no + vars: + threescale_cicd_policies_to_update: '{{ lookup(''file'', playbook_dir ~ ''/custom-policy-chain.json'')|from_json }}' + roles: + - nmasse-itix.threescale-cicd +```