bolt icon indicating copy to clipboard operation
bolt copied to clipboard

install module with ssh transport

Open mcarrolle opened this issue 2 years ago • 2 comments

Describe the Bug

Since bolt 3.25.0, we can no longer install module from git private repository with SSH transport. URIs starting with ssh:// are no longer accepted in the file bolt-project.yaml. Returned error:

Invalid URI ssh://git@mygitlabserver:12345/namespace/myprivatemod.git. Valid URIs must begin with 'git@', 'http://', or 'https://'.

e.g bolt-project.yaml :

modules:
  - name: myprivatemod
    git: ssh://git@mygitlabserver:12345/namespace/myprivatemod.git
    ref: main
    resolve: false

Expected Behavior

When running command bolt module install git repository is fetched with SSH transport.

mcarrolle avatar Sep 21 '23 12:09 mcarrolle

Does it work if you remove the ssh:// ? This is the commit that caused the change https://github.com/puppetlabs/bolt/commit/0a090696cb5807640e894fdbc0d6158edf70184f It is unclear to me how that was working before, take a look at that code and let me know if there is a change you would like to see.

donoghuc avatar Oct 04 '23 22:10 donoghuc

Removing the protocol prefix ssh:// doesn't work because bolt is fetching the module with git transport protocol.

Output when fetching module with ssh transport from a old bolt version:

Cloning /Boltdir/.modules/myprivatemod and checking out master
Starting process: ["git", "clone", "ssh://git@mygitlabserver:12345/namespace/myprivatemod.git", "/Boltdir/.modules/myprivatemod", "--reference", "/home/boltrunner/.r10k/git/ssh---mygitlabserver-12345-namespace-myprivatemod.git"]
Finished process:
Command: git clone ssh://git@mygitlabserver:12345/namespace/myprivatemod.git /Boltdir/.modules/myprivatemod --reference /home/boltrunner/.r10k/git/ssh---mygitlabserver-12345-namespace-myprivatemod.git
Stderr:
Cloning into '/Boltdir/.modules/myprivatemod'...
Exit code: 0

Fix to try: Adding check of prefix ssh:// in method valid_url

mcarrolle avatar Oct 05 '23 07:10 mcarrolle

@donoghuc can this be closed with the PR on May 1st ?

davidsandilands avatar Jun 19 '24 14:06 davidsandilands

yes

donoghuc avatar Jun 20 '24 14:06 donoghuc