# delegate\_to with host

**URL:** <https://forum.ansible.com/t/delegate-to-with-host/34987>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [April 15, 2021, 8:44am UTC](https://forum.ansible.com/t/delegate-to-with-host/34987 "2021-04-15T08:44:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bit\_minter](https://avatars.discourse-cdn.com/v4/letter/b/858c86/32.png) [@bit\_minter](https://forum.ansible.com/u/bit_minter)\
**Post date:** [April 15, 2021, 8:44am UTC](https://forum.ansible.com/t/delegate-to-with-host/34987/1 "2021-04-15T08:44:36Z")

</div>

Hi, I want to delegate\_to a specified host in awx. How do I do it ?

delegate\_to: “{{hosts[‘management-server’]}}” is not working.

error: “hosts undefined”

 ![Screenshot 2021-04-15 104403.jpg](https://us1.discourse-cdn.com/ansible/original/2X/5/52b8a8a7deee3f81642cfd4c526d06b008b60c5a.jpeg)

---

<div class="post-metadata">

**Author:** ![ffirg](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ffirg/32/10029_2.png) [@ffirg](https://forum.ansible.com/u/ffirg)\
**Post date:** [April 16, 2021, 7:06am UTC](https://forum.ansible.com/t/delegate-to-with-host/34987/2 "2021-04-16T07:06:05Z")

</div>

So it’s saying hosts is undefined, no the management server. Try using inventory\_hostname instead of hosts.
