I need to modify a line in a configuration file with the private IP addresses of the hosts in the zookeeperservers inventory group.
The config file is an .xml file.
The key word in the config file is "Connect String">.
There are 3 hosts in the zookeeperservers inventory group i.e., zoo1, zoo2, and zoo3.
I would like to insert a line immediately after "Connect String"> (i.e., immediately after the ">" symbol, and what I would like to insert is private ip address of zoo1:2181,private ip address of zoo2:2181, private ip address of zoo3:2181.
So the line to be added to this line immediately after the > would look like this:
10.42.239.2:2181,10.42.227.227:2181,10.42.237.9:2181.
The values above :2181 would be a string. I would like to use values from ansible to populate the private ip addresses.
Can someone provide guidance on how I can do this?