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"