Hello,
I am trying to update nginx file, I need to add 4 more lines before the ;
I tried blockinfile, lineinfile, replace and sed but I am unable to get the
required output
ex: the below one is some part of my nginx file,
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status
$body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
I need to add *'$request_time ' '$upstream_response_time '
'$upstream_connect_time' '$upstream_header_time' to the existing line
before the ; *
*blockinfile is somewhat worked but the nginx file end up having ; after *
'"$http_user_agent"
"$http_x_forwarded_for"'
my desired output is
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status
$body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"' *'$request_time '
'$upstream_response_time ' '$upstream_connect_time'
'$upstream_header_time' *;
someone please help me with a solution, I have lot of servers across
multiple environments which cannot be done manually.
--
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/d00e73ae-965d-4a24-9843-8cc37b06010fn%40googlegroups.com.