Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install module with ssh transport #3237

Closed
mcarrolle opened this issue Sep 21, 2023 · 4 comments
Closed

install module with ssh transport #3237

mcarrolle opened this issue Sep 21, 2023 · 4 comments
Labels
Bug Bug reports and fixes.

Comments

@mcarrolle
Copy link
Contributor

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 mcarrolle added the Bug Bug reports and fixes. label Sep 21, 2023
@donoghuc
Copy link
Member

donoghuc commented Oct 4, 2023

Does it work if you remove the ssh:// ? This is the commit that caused the change 0a09069 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.

@mcarrolle
Copy link
Contributor Author

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 added a commit to mcarrolle/bolt that referenced this issue May 7, 2024
!bug

* **allow ssh transport protocol** ([puppetlabs#3237](puppetlabs#3237))

  Fix regression introduced by commit [0a09069](puppetlabs@0a09069).
  Allow install module from git private repository with SSH transport URI (e.g ssh://git@mygitlabserver:12345/namespace/myprivatemod.git)
mcarrolle added a commit to mcarrolle/bolt that referenced this issue May 9, 2024
!bug

* **Allow ssh transport protocol** ([puppetlabs#3237](puppetlabs#3237))

  Fix regression introduced by commit [0a09069](puppetlabs@0a09069).
  Allow install module from git private repository with SSH transport URI (e.g ssh://git@mygitlabserver:12345/namespace/myprivatemod.git)
@davidsandilands
Copy link
Member

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

@donoghuc
Copy link
Member

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug reports and fixes.
Projects
None yet
Development

No branches or pull requests

3 participants