oh man, this is awesome it worked like a charm, you saved lot of my time
log_format main '$remote_addr -
$remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'
There's the problem, and also why it's so important to include all the
relevant details up front.
The regexp starts with "^log_format", i.e. it's expecting the 'l' of
"log" to be in the first column, but you've got leading white space
before "log_format". Change the regexp line thus:
yes the path is /etc/nginx/nginx.conf, in my earlier email I removed that.
this is the portion from the existing nginx file
http {
log_format main '$remote_addr -
$remote_user [$time_local] "$request" '
Add "-vv" and "--diff" to your command line.
Can you show us the relevant portion of the file /nginx/nginx.conf so we
can try to reproduce? (And you really have that in the root? I'd expect
/etc or /opt or /opt/local before /nginx, but, whatever.)
On 11/1/23 2:27 PM, Narmada Karthika wrote:
- name: replace log_format settings on nginx
ansible.builtin.replace:
path: /nginx/nginx.conf
regexp: '^log_format +main +[^;]+;\n'
replace: 'log_format main {{ bits | map("quote") | join("\n
") }};\n'
vars:
bits:
-
yes, I modified the playbook to my data accordingly ..
On Wed, Nov 1, 2023 at 11:20 AM Todd Lewis wrote:
> Then, um, fix what's wrong. (?) I'd be more specific, but you didn't give
> me much to work with. Post the task and relevant variables.
> Note the "path:" I used on my localhost isn't what
Then, um, fix what's wrong. (?) I'd be more specific, but you didn't
give me much to work with. Post the task and relevant variables.
Note the "path:" I used on my localhost isn't what you need.
Also, I didn't add the those extra data you want to add:
*'$request_time ' '$upstream_response_time '
Thankyou, I tried the above playbook, there is no syntax error but it is
not changing anything.
On Tuesday, October 31, 2023 at 8:35:32 PM UTC-7 Todd Lewis wrote:
> Something like this, perhaps:
>
> - name: Do the a.b.replace thing
> ansible.builtin.replace:
> path:
It's hard to tell from this platform's poor support of indentation, but it
appears "hostenv" is a list. Try
loop: "{{ hostenv[0].Serverconf.Interface }}"
On Wednesday, November 1, 2023 at 9:35:35 AM UTC-4 Vaishnave M wrote:
> Hi,
>
> I have list of items in configuration files as variable
>
The short answer is no. If you want to modify the string with backrefs,
then lineinfile will not create the line if it doesn't exist.
But step back and consider your options for managing your override.conf
file.
A. The best scenario is to take total ownership of the entire file,
generating
Hi community,
I am seeking your advise on CIS hardening guide of window server 2012R2,
2016 or 2019 using ansible. I am relatively new in ansible knowledge and
appreciate if you could share the code repo , sample codes , ansible galaxy
, blogs or any other resources that I can start working
Hi,
I have list of items in configuration files as variable
hostenv:
- env: test
Serverconf:
Resource:
- mem:
Interface:
- { name: eth0, address: 10.0.10.2}
- {eth1: .}
Now, I would like to fetch and print the values from interface {{
Hello Team,
I could figure out after 10 tries this is how i got it
- name: append the line
lineinfile:
path: /tmp/hello.txt
backrefs: yes
regexp: '^(.*KAFKA_JMX_OPTS.*)$"'. <
line: '\1
We want to only append string
-javaagent:{{jmxexporter_jar_path}}={{zookeeper_jmxexporter_port}}:{{zookeeper_jmxexporter_config_path}}"'
to a file override.conf
if we have "Environment="KAFKA_JMX_OPTS" in it else
add new line "actual line"
Let me try with block and serial and get back to you
On Wednesday, November 1, 2023 at 5:33:14 AM UTC+5:30 Will McDonald wrote:
> Edit: s/along with a failed_when/along with wait_for/
>
> On Tue, 31 Oct 2023 at 23:58, Will McDonald wrote:
>
>> I don't entirely understand your approach,
15 matches
Mail list logo