# renaming hosts

**URL:** <https://forum.ansible.com/t/renaming-hosts/32507>\
**Category:** Ansible Project\
**Created:** [March 21, 2020, 4:07am UTC](https://forum.ansible.com/t/renaming-hosts/32507 "2020-03-21T04:07:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joe3](https://avatars.discourse-cdn.com/v4/letter/j/c67d28/32.png) [@Joe3](https://forum.ansible.com/u/Joe3)\
**Post date:** [March 21, 2020, 4:07am UTC](https://forum.ansible.com/t/renaming-hosts/32507/1 "2020-03-21T04:07:13Z")

</div>

I’m fairly new to ansible, so I’m still learning it. Please bare with me. I have a variable file that defines maps current hostnames of devices to new hostnames. I’m trying to write a playbook that will re the variable file and change the hostnames of the devices. So far I haven’t had any luck, can some one tell me where I’m going wrong with this?

The variable file and play book are pasted below

[joec@automation change\_hostname]# cat hostname.yml
