Failure to establish connection when provisioning via ansible-playbook server.yml

I’ve also posted this question on discourse and @fullyint has answered it in detail. So I’m just posting a link for the answer and some excerpt

Helping Ansible and ssh to find the necessary private key

This means that you are manually specifying the private key with each ssh command, and yes, the corollary of manually specifying the private key with every ansible-playbook command is to add the –private-key= or key-file= option. However, you could save yourself some hassle by enabling ssh and ansible-playbook commands to automatically find and use your desired private key file. One approach would be to add an entry to your ssh config file, specifying the IdentityFile to be used with Host 10.10.2.5. I’d recommend the alternative of loading the ~/.ssh/dummy_rsa into your ssh-agent, which can handle keys for you, trying multiple private keys when attempting a connection.
Make sure your ssh-agent is running: ssh-agent bash
Add your key: ssh-add ~/.ssh/dummy_rsa
If you’re on mac, add the key to your Keychain: ssh-add -K ~/.ssh/dummy_rsa
Now you should be able to run ssh commands without the -i option, and ansible-playbook commands without the –key-file= option because your ssh-agent will inform those commands of the various available private keys to try in making the ssh connections.

Reasons for the error “sudo: a password is required”

Of the tasks Trellis runs via the server.yml playbook, some require sudo. This is a non-issue when the playbook connects as root, but sometimes the playbook doesn’t connect as root. If this initial connection attempt as root fails, it will fall back to connecting as the admin_user. This user must specify its sudo password via the option –ask-become-pass, as you discovered.
Maybe you already know why your connection as root failed, but here are some possibilities:
Maybe your remote is on AWS, where root is disabled by default, and your admin_user: ubuntu.
Maybe you’ve already successfully run server.yml with sshd_permit_root_login: false in group_vars/all/security.yml, so root is no longer allowed to log in via ssh (good security).
Maybe the private key you are trying to use is not loaded on the remote in the root user’s authorized_keys