Hi Team,
I have the file with the below content.
“Bamboo”: {
“Endpoint”: “http://xx.xx.xxx.xxx:800”,
“Zookeeper”: {
“Host”: “//xx.xxx.xxx.xx:2181,xx.xxx.xxx.xx:2181,xx.xxx.xxx.xx:2181”,
“Path”: “/marathon-haproxy/state”,
“ReportingDelay”: 5
}
},
I wanted to dynamically update the below line using lineinfile
“Endpoint”: “http://xx.xx.xxx.xxx:800”,
My Ansible has the below code
lineinfile: dest=/var/bamboo/production.json.bak state=present regexp=“^ "Bamboo"”:" {" insertafter=" "Bamboo"“:”{" line=" "Endpoint"“:” "http://{{ansible_default_ipv4.address}}:8080" "
For some reason, it is adding the line to the EOF.
Can someone please suggest on how can i fix it?