uri check all hosts in a group

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
  tasks:

    - name: local test on behalf of remote
      local_action: shell echo "hi, I'm executing on a host in this
group, but am thinking about $ansible_hostname"

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

Arrrrg!

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

You mean $inventory_hostname, right?