install module with ssh transport
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.
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.
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
@donoghuc can this be closed with the PR on May 1st ?
yes