Look at the "lineinfile" module.

On Monday, August 29, 2016 at 10:24:36 AM UTC-4, BB wrote:
>
> I need to replace public ip from /etc/hosts file with private ip in bulk 
> cluster of systems.
> Ansible gathered fact , may work but not sure which is for what.
>
> Another way, I can have public and private ip register as variable and 
> swap them.
>
> What would be the best practice to do in ansible way?
>
> Currently in /etc/hosts 
> ________
> public_ip   hostname short_hostname
>
> I need to change it to 
>
> private_ip  hostname short_hostname
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/49551c3b-7e0a-4086-a48f-994f6ae665b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to