template fix to avoid extra characters in vault policy

This commit is contained in:
Anton Nerozya 2017-07-13 15:57:58 +02:00
parent 09d664dc09
commit e37f334373

View file

@ -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 }}"