If IP changes by hostname stays the same 2 entries are created.

add the create_by_host action which will change the IP, but keep the hostname constant.

Useful in the case where a machine may be replaced with a new IP, but you want to update the hostfile entry, not create a new one.

Docs give example 
https://github.com/shokunin/hostsfile#create_by_host