From e37f334373c3473c49390093aa20b1f3a3250a98 Mon Sep 17 00:00:00 2001 From: Anton Nerozya Date: Thu, 13 Jul 2017 15:57:58 +0200 Subject: [PATCH] template fix to avoid extra characters in vault policy --- roles/vault/tasks/shared/create_role.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/vault/tasks/shared/create_role.yml b/roles/vault/tasks/shared/create_role.yml index 1ab27ec37..59a23eccb 100644 --- a/roles/vault/tasks/shared/create_role.yml +++ b/roles/vault/tasks/shared/create_role.yml @@ -9,16 +9,16 @@ body_format: json body: rules: >- - {%- if create_role_policy_rules|d("default") == "default" -%} + {%- if create_role_policy_rules|d("default") == "default" %} {{ { 'path': { - 'pki/issue/' + create_role_name: {'policy': 'write'}, - 'pki/roles/' + create_role_name: {'policy': 'read'} - }} | to_json + '\n' + 'pki/issue/' + create_role_name: {'policy': 'write'}, + 'pki/roles/' + create_role_name: {'policy': 'read'} + }} | to_json }} {%- else -%} - {{ create_role_policy_rules | to_json + '\n' }} - {%- endif -%} + {{ create_role_policy_rules | to_json }} + {%- endif %} status_code: 204 when: inventory_hostname == groups[create_role_group]|first ignore_errors: "{{ ansible_check_mode }}"