I want to replace a string in between two @ characters
Something like this
Hi I am @Something.great@ from a planet @planet.outside.earth@
from a properties file where values are
Something.great = Niel Armstrong planet.outside.earth = Mars
So this should convert the above text to
Hi I am Niel Armstrong from a planet Mars
I have to achieve this using Ansible
Using lookup and replace
EDIT 1:
No For the two answers below. I don't have any idea what keys I have in between N number of files. I have to search a regex in folder having 100 files may contain 1000 keys in between @myKey@ .
So I have to First search what is the value in file in this case myKey which has to come from some regex search and then lookup that search value in a lookup properties file where the value of myKey is present.
My properties file looks like this.
myKey=Ankit
YourKey=Kevin
OtherKey=Vladimir