puppetlabs / bolt

Bolt is an open source orchestration tool that automates the manual work it takes to maintain your infrastructure on an as-needed basis or as part of a greater orchestration workflow. It can be installed on your local workstation and connects directly to remote nodes with SSH or WinRM, so you are not required to install any agent software.
https://puppet.com/docs/bolt/latest/bolt.html
Apache License 2.0
493 stars 222 forks source link

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

Open h0tw1r3 opened 2 months ago

h0tw1r3 commented 2 months ago

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

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.

donoghuc commented 1 month ago

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.

h0tw1r3 commented 1 month ago

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 commented 1 month ago

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.