# replace or lineinfile or ?

**URL:** <https://forum.ansible.com/t/replace-or-lineinfile-or/28310>\
**Category:** Ansible Developer\
**Tags:** ansible-devel\
**Created:** [August 10, 2018, 11:58am UTC](https://forum.ansible.com/t/replace-or-lineinfile-or/28310 "2018-08-10T11:58:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxamillion](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/maxamillion/32/98_2.png) [@maxamillion](https://forum.ansible.com/u/maxamillion)\
**Post date:** [August 10, 2018, 11:58am UTC](https://forum.ansible.com/t/replace-or-lineinfile-or/28310/1 "2018-08-10T11:58:21Z")

</div>

> For a replication project i have to dynamic create an .sql for execute with mariadb.  
> i have two hosts (A and B) in my host variables, both with name, ip and ID.
> 
> i think about create a local file, copy it to the destination hosts and then ?  
> i need to put the ip address from Server A in the file for Server B.  
> And the Adress from Server B in the file for Server A.
> 
> Does anyone has an idea how to do this quickly?

I think this line of discussion is best suited for the ansible-project  
list as that's more focused on users of Ansible aiming to solve real  
world problems and share solutions, but this list is meant for  
discussion of developing Ansible itself.

Thank you,  
-AdamM
