On Tue, 27 Oct 2020 at 21:47, Roy Lenferink <[email protected]> wrote:
>
>
>
> Op dinsdag 27 oktober 2020 om 20:01:15 UTC+1 schreef [email protected]:
>>
>> By the var name I guess you're using the jeff geerling's apache role?
>> I use that too and also ran into this issue.
>> You need to escape the jinja looking part.
>> My snippet:
>>
>> apache_global_vhost_settings: |
>> # Sortable log format, with federated username.
>> LogFormat "%v:%p %{{'{%'}}F %T}t.%{msec_frac}t %h %u \"%r\" %>s %O
>> \"%{Referer}i\"\
>> \"%{User-Agent}i\"" vhost_federated_combined
>>
>
> Well great! This was the exact problem. After substituting %{%Y with 
> %{{'{%'}}Y it worked !!

It may be even easier if you wrap the entire thing in 'raw'. This
should be fine as you don't use jinja inside that LogFormat statement.
Hence the value will be just in the YAML as-is, i.e. easier to debug:

  {% raw %}
  LogFormat "%v:%p %{%F %T}t.%{msec_frac}t %h %u \"%r\" %>s %O \"%{Referer}i\"\
    \"%{User-Agent}i\"" vhost_federated_combined
  {% endraw %}

Both methods yield the same result, so use which one is easier in your case.
IIRC I didn't use 'raw' because it messed up the yaml syntax
highlighting in my editor.


Dick

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwObh6y5GvyN3ZRhOA1F_t0eQRgWXwGfDNtOw1YSc8cn%3DQ%40mail.gmail.com.

Reply via email to