# migrate server - from dhcp to static ip

**URL:** <https://forum.ansible.com/t/migrate-server-from-dhcp-to-static-ip/22539>\
**Category:** Ansible Project\
**Created:** [September 13, 2016, 10:04pm UTC](https://forum.ansible.com/t/migrate-server-from-dhcp-to-static-ip/22539 "2016-09-13T22:04:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fidel\_Dominguez-Vale](https://avatars.discourse-cdn.com/v4/letter/f/a9a28c/32.png) [@Fidel\_Dominguez-Vale](https://forum.ansible.com/u/Fidel_Dominguez-Vale)\
**Post date:** [September 13, 2016, 10:04pm UTC](https://forum.ansible.com/t/migrate-server-from-dhcp-to-static-ip/22539/1 "2016-09-13T22:04:35Z")

</div>

There are any way to migrate the existing network configuration (IP, Netmask, Gateway) to static IP using ansible?

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [October 9, 2016, 10:28am UTC](https://forum.ansible.com/t/migrate-server-from-dhcp-to-static-ip/22539/2 "2016-10-09T10:28:04Z")

</div>

Ansible don't have a module that do this.  
But all the tools is available to configure it.

With facts you find the IP, netmask and gateway and with template module or blockinfile module you can change the file for the static configuration.
