Fatal: [192.168.50.5] => SSH Error: Permission denied (publickey)

Thanks for the quality response, trying things, and posting output.

github_ssh_keys were completely removed/replaced by roots/trellis#247 June 23, 2015. All ssh key handling is done using that users dictionary in group_vars/all. In the future if you want to run just the users role you can use --tags "users", but we’ll need to get your SSH connection working first.
(You can remove your github_ssh_keys definition from your group_vars/staging.)

Have you been able to get the server.yml playbook to work on any staging/production server before?

Would you mind testing whether things will work by forcing the playbook to try connecting as root instead of how it is ending up trying admin? It shouldn’t work, but if it does, I think it would show that I missed something in my logic in roots/trellis#274. To try it…

  • comment out the entire “Determine Remote User” play
  • in the the main “WordPress Server - Install LEMP…” play, and add this new line right under hosts:
    remote_user: root
  • re-run the playbook

It seems curious that manual ssh root@45.55.25.7 succeeds but things fail when ansible tries ssh -o PasswordAuthentication=no root@45.55.25.7. If you’re willing, you could also tell us what the output is when you run this:

ssh -o PasswordAuthentication=no root@45.55.25.7 "echo can_connect" || echo cannot_connect

I’m wondering, probably naively, whether the extra option -o PasswordAuthentication=no somehow isn’t working well on your system.