bolt icon indicating copy to clipboard operation
bolt copied to clipboard

Bolt installed from package on linux fails to install modules from git

Open h0tw1r3 opened this issue 1 year ago • 3 comments

Describe the Bug

bolt fails to module install when modules are sourced from git on Linux because the bolt packages (rpm, deb) do not require the git package.

Installing project modules

  → Syncing modules from /root/project/Puppetfile to /root/project/.modules

No Git providers are functional.
Failed to sync modules from /root/project/Puppetfile to /root/project/.modules

Expected Behavior

No error, all modules install.

Steps to Reproduce

docker exec -it litmusimage/ubuntu:22.04 /bin/bash -l
wget https://apt.puppet.com/puppet-tools-release-jammy.deb
dpkg -i puppet-tools-release-jammy.deb
apt-get update 
apt-get install puppet-bolt
mkdir /root/project && cd /root/project
bolt project init project
/opt/puppetlabs/bolt/bin/ruby <<EOF
require 'yaml'
x = YAML.load_file('bolt-project.yaml')
x['modules'] = [{ git: 'https://github.com/puppetlabs/provision', ref: 'main' }]
File.write('bolt-project.yaml', x.to_yaml)
EOF
bolt module install

Environment

  • Anything that runs docker
  • I used Ubuntu 20.04, doesn't matter

Additional Context

https://www.puppet.com/docs/bolt/latest/bolt_installing_modules.html#git-modules

Also fails with the puppet-bolt docker container. Somewhat defeats the point of using a container if it needs to be extended to add git support.

h0tw1r3 avatar May 03 '24 07:05 h0tw1r3

Thanks for filing this. We are not keen on vendoring git, maybe its time to add it as a package dependency. We can at least document this for now.

donoghuc avatar May 06 '24 22:05 donoghuc

Agreed. I think it would take just as much effort to document "install this package for X" as it does to just add the dependency to the package. Actually more, as I've already done the linked PR :)

h0tw1r3 avatar May 06 '24 23:05 h0tw1r3

For visibility, sourcing modules from git is a common use case, just as common as with a control-repo Puppetfile. Every professional engagement I've been on, internal modules are sourced from git.

h0tw1r3 avatar May 06 '24 23:05 h0tw1r3