# ansible inventory name: "{{ inventory\_hostname }}"

**URL:** <https://forum.ansible.com/t/ansible-inventory-name-inventory-hostname/24211>\
**Category:** Ansible Project\
**Created:** [April 12, 2017, 7:16pm UTC](https://forum.ansible.com/t/ansible-inventory-name-inventory-hostname/24211 "2017-04-12T19:16:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Recchia](https://avatars.discourse-cdn.com/v4/letter/r/d26b3c/32.png) [@Robert\_Recchia](https://forum.ansible.com/u/Robert_Recchia)\
**Post date:** [April 12, 2017, 7:16pm UTC](https://forum.ansible.com/t/ansible-inventory-name-inventory-hostname/24211/1 "2017-04-12T19:16:23Z")

</div>

Something weird is happening. I am creating a playbook that I would like to run when new hosts are built - they are standard centos 7 vms minimal install.

when this part of the playbook is completed

- name: Ensure hostname is same as ansible inventory  
hostname:  
name: “{{ inventory\_hostname }}”

the prompt on the server changes from this [root@ansible-testing ~]#

to

[root@10 ~]#

Nothing changes in /etc/bashrc /etc/profile ~/.bashrc - how is this getting changed.

---

<div class="post-metadata">

**Author:** ![Duncan\_Hutty](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@Duncan\_Hutty](https://forum.ansible.com/u/Duncan_Hutty)\
**Post date:** [April 12, 2017, 9:20pm UTC](https://forum.ansible.com/t/ansible-inventory-name-inventory-hostname/24211/2 "2017-04-12T21:20:53Z")

</div>

Troubleshooting hints:  
1) What is the output from ansible-playbook -v when it executes that task?  
2) What does `hostname --fqdn` (assuming linux) return after the fact?
