- using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
- using inventory:
127.0.0.1 ansible_connection=local
- using Ansible configuration file:
[defaults]
transport = local
- using playbook header:
- hosts: 127.0.0.1
connection: local
But if I have'nt understood this badly (https://docs.ansible.com/ansible/latest/inventory/implicit_localhost.html), it isn't necessary to indicate explicitely the connection type: just writing "localhost" as target will make Ansible to infer it has to make a "local" connection, isn't?