Have you tried this to see if it removes the extra ident?

...                                                                             
                                      
{{ logging('fluentd') }}                                                        
                                   
...


On Wednesday, October 31, 2018 at 3:39:22 AM UTC-7, ProfHase wrote:
>
> Hi @all,
>
> I am trying to use a macro in an ansible template:
>
> {% macro logging(ltype) %}
>
> {% if ltype == 'fluentd' %}
> logging:
>   driver: 'fluentd'
>   options:
>     tag: "{{ app_name }}.{{ '{{' }}.Name{{ '}}' }}"
>     labels: "mylabel"
> {% endif %}
> {% endmacro %}
>
> ...                                                                           
>                                         
>    {{ logging('fluentd') }}                                                   
>                                         
> ...
>
>
> When I render it (template module), I am always getting
>
> ...
>    logging:
>   driver: 'fluentd'
>   options:
>     tag: "test.{{.Name}}"
>     labels: 
> "fhg.iam.appname,fhg.iam.hostname,fhg.iam.publicip,fhg.iam.privateip"
>
> ...
>
> So apparently 'logging is indented right, but everything else just loses 
> its indentation. Has anyone else got any similar problem?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/175e9a8b-dba9-4277-b7a8-0adf4be11b08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to