Can you use R10K to deploy from a private repo?

I've got a internal gitlab server containing a repo that I need to be private, when I try to run r10k on the Puppetfile I get the following error stating that it could not read Username, but I can not find how to define a username in the docs for R10K

Task # failed while running: Couldn't update git cache for https://git.comp.com/puppet/repo.git: "fatal: could not read Username for 'https://git.comp.com': No such device or address"

I've also tried to use the ssh protocol as follows:

mod "mymodule",
:git => "ssh://git@git.comp.com:puppet/mymodule.git"

which results in an error:
failed while running: Couldn't update git cache for ssh://git@git.comp.com:puppet/mymodule.git: "fatal: Could not read from remote repos

while git clone git@git.comp.com:puppet/mymodule.git works like a charm

1 Answer

R10k simply invokes GIT in order to clone the repositories defined in your Puppetfile. If you wish to configure authentication, you may do so using any of GIT's builtin authentication methods.

The simplest form of authentication is to use SSH authorized keys. With this approach, you would create a public/private SSH keypair for the user that invokes R10k (typically root, but may be site-specific,) and authorize that public key to connect to your repository.

You may also use HTTP authentication, of course by embedding the username and password in the repository URL.

Look at the difference between those two URIs. You should able to take the value for :git and, as the r10k user (typically root), call "git clone <uri>". If you receive errors, diagnose and repeat till it works. Then r10k should be able to clone it as well.