# uri check all hosts in a group

**URL:** <https://forum.ansible.com/t/uri-check-all-hosts-in-a-group/12498>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [March 14, 2013, 3:30am UTC](https://forum.ansible.com/t/uri-check-all-hosts-in-a-group/12498 "2013-03-14T03:30:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [March 14, 2013, 3:30am UTC](https://forum.ansible.com/t/uri-check-all-hosts-in-a-group/12498/1 "2013-03-14T03:30:24Z")

</div>

Yeah, you're talking about the local action usecase. You do not  
specify the local connection here, nor the local host. Do it like so,  
using delegation...

- hosts: groupname  
&nbsp;&nbsp;tasks:

&nbsp;&nbsp;&nbsp;&nbsp;- name: local test on behalf of remote  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local\_action: shell echo "hi, I'm executing on a host in this  
group, but am thinking about $ansible\_hostname"

&nbsp;&nbsp;&nbsp;&nbsp;- name: remote test  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shell: echo "this would still execute on the remote side"

---

<div class="post-metadata">

**Author:** ![Yves\_Dorfsman](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@Yves\_Dorfsman](https://forum.ansible.com/u/Yves_Dorfsman)\
**Post date:** [March 14, 2013, 4:01am UTC](https://forum.ansible.com/t/uri-check-all-hosts-in-a-group/12498/2 "2013-03-14T04:01:34Z")

</div>

Arrrrg!

I ended up writing a playbook just to verify if you made a typo or if I missed another magic variable! 🙂

You mean $inventory\_hostname, right?
