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

ESTABLISH CONNECTION FOR USER: admin
If it is trying to connect as admin at this point, that means that root wasn’t able to connect in the previous tasks (assuming you’re using a trellis version at least as new as db63a89 July 26, 2015). However, I’m guessing you haven’t yet had a successful run of server.yml on staging, so root login probably couldn’t be disabled yet. This leaves the question of why can’t root connect?

Manual ssh. Let us know if you think you’ve already disabled root login.
If not, are you saying that running ssh root@45.55.25.7 succeeds?
If you’ve disabled root, has the full server.yml playbook ever succeeded on this staging server? If so, let us know if running ssh admin@45.55.25.7 succeeds.

known_hosts. Could you open ~/.ssh/known_hosts and remove any entries for 45.55.25.7 and your staging server domain name, then see if the ansible-playbook command succeeds in connecting?

Debug info. If it still fails, could you run it with -vvvv for more verbose output and share the output here?
ansible-playbook -i hosts/staging server.yml -vvvv

Trellis on your machine. Have you been able to get the server.yml playbook to work on any staging/production server before? (that would tell us whether your machine/environment is already set up correctly for Trellis)

Any potentially relevant customizations you’ve made? If many, you might try getting it to work with just a vanilla trellis install first, then start adding customizations and testing as you go.

1 Like