How to set default Ansible username/password for SSH connection?

You can add following section to your inventory file:

[all:vars]
ansible_connection=ssh
ansible_user=vagrant
ansible_ssh_pass=vagrant

Note: Before Ansible 2.0 ansible_user was ansible_ssh_user.

Leave a Comment