SSH keys when deploying a site using a private GitLab repo

New to bedrock and ansible. Sorry if this has been covered elsewhere.

I’m going through the steps outlined in: GitHub - roots/roots-example-project.com: Example Roots stack project (Trellis, Bedrock, Sage)

I pushed to a private repo on a company-owned GitLab server.

In my production environment config, I have a single Wordpress site with: repo: git@mygitlabdomain.com:bryan.downing/wp-bedrock.git

It seems like it would be necessary to manually SSH into the remote server (after the server has been provisioned with server.yml), generate SSH keys for the web user, and add the public key to GitLab for the bryan.downing user.

Is that correct? I feel like there’s some config I’m missing somewhere.

I ran the deploy script, and it hung on TASK: [deploy | Clone project files]. I’m assuming it hung on a password prompt.

1 Like

See if this has the info you need:

You just need to get your public key on the server on the web user (see link that @fullyint posted). After that SSH forwarding handles the rest (which you obviously need working).

https://developer.github.com/guides/using-ssh-agent-forwarding/

Wow, I swear I’ve read that wiki page. I completely missed the info about connecting to private repos. Thanks!

Not sure you did. I added it after you posted this :smile:

1 Like

Cheater…

1 Like