Op dinsdag 27 oktober 2020 om 19:36:31 UTC+1 schreef [email protected]:

> On 10/27/20 8:21 PM, Roy Lenferink wrote: 
> > Hello everyone, 
> > 
> > I am having a problem with defining a string variable in Ansible 
> (v2.9.9) 
> > 
> > The string I want to define (for the geerlingguy.apache role): 
> > apache_global_vhost_settings: | 
> >   LogFormat "<%%JSON:httpd_access%%> { \"time\": \"%\{%Y}t\" }" combined 
> >   CustomLog logs/access_log combined 
> > 
> > This doesn't work and I am getting the following error message: 
> > /template error while templating string: Encountered unknown tag 'Y'.. 
> String: LogFormat//  <snip>/ 
> > 
> > It basically comes down to the following part: \"%\{%Y}t\" } 
> > 
> > How can I achieve the specified string in Ansible ? I tried escaping 
> several properties however wasn't able to find out 
> > a solution. 
>
> Well, how should the expected LogFormat line look like? 
>

What I want to achieve is the following:
https://pastebin.com/0DqXksdq

(I put it on pastebin since the full string can be messed up in e-mail)

But to get there I first tried to add the following line to be part of the 
Ansible variable (which throws the error already):
*LogFormat "<%%JSON:httpd_access%%> { \"time\": \"%{%Y-%m-%dT%H:%M:%S%z}t\" 
}" combined*
 
Roy

 

Regards 
> Racke 
>
> > 
> > Best regards, 
> > Roy 
> > // 
> > 
> > -- 
> > 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] <mailto:
> [email protected]>. 
> > To view this discussion on the web visit 
> > 
> https://groups.google.com/d/msgid/ansible-project/2a810b8d-48a3-4157-b3ca-2048cd022de5n%40googlegroups.com
>  
> > <
> https://groups.google.com/d/msgid/ansible-project/2a810b8d-48a3-4157-b3ca-2048cd022de5n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>  
>
>
>
> -- 
> Ecommerce and Linux consulting + Perl and web application programming. 
> Debian and Sympa administration. Provisioning with Ansible. 
>
>

-- 
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/f4ac4a30-3e33-4811-821f-4e1a51820484n%40googlegroups.com.

Reply via email to