# changing hostname/ipadress

**URL:** <https://forum.ansible.com/t/changing-hostname-ipadress/20717>\
**Category:** Ansible Project\
**Created:** [March 1, 2016, 7:57am UTC](https://forum.ansible.com/t/changing-hostname-ipadress/20717 "2016-03-01T07:57:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daan\_Hoogland](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@Daan\_Hoogland](https://forum.ansible.com/u/Daan_Hoogland)\
**Post date:** [March 1, 2016, 7:57am UTC](https://forum.ansible.com/t/changing-hostname-ipadress/20717/1 "2016-03-01T07:57:01Z")

</div>

LS,

When a play I write changes the adres or name by which a host is adressed (i.e. ansible\_host value) is it possible to tell ansible to use a new value for this target from there on? I am trying to recreate an instance in a cloud. after the recreation some simple lineinfile, user, authorized\_key and package tasks need to be performed.

regards,  
Daan

---

<div class="post-metadata">

**Author:** ![Daan\_Hoogland](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@Daan\_Hoogland](https://forum.ansible.com/u/Daan_Hoogland)\
**Post date:** [March 6, 2016, 10:58am UTC](https://forum.ansible.com/t/changing-hostname-ipadress/20717/2 "2016-03-06T10:58:33Z")

</div>

FYI, I didn’t find a way to do this but worked around by creating a ad-hoc group with add\_host.
