Had a client with a deployment tool that would copy a bundle of Ansible to each host and run  ansible-playbook locally on each host defined. This had some interesting side effects where you want to the same play on multiple hosts


host1.domain.net ansible_connection=local
host2.domain.net ansible_connection=local

Normally this would force all members of the webservers group to be run locally, so used the following little block:

- hosts: webservers

    - name: foo
        msg: "test message for {{ ansible_hostname }} - {{ ansible_fqdn }} - {{ ansible_host }}"
      when: ansible_host == ansible_hostname