Answer the question
In order to leave comments, you need to log in
ANSIBLE How to add IP to existing entries in a string using a regular expression (explained under the cut)?
Hello,
there is a file: /opt/firewall-rules.sh
It contains a line like this: TESTING="111.111.111.111/32,111.111.111.112/32"
Tell me how to add a third ip entry to the two existing ones using the lineinfile module - 111.111.111.113/32, so that as a result the line looks like this
TESTING="111.111.111.111/32,111.111.111.112/32,111.111.111.113/32"
Answer the question
In order to leave comments, you need to log in
The ansible documentation has an example of how to insert a line after a certain one inline, what is the question
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question