Hi, the Bolt team (hope someone will be there)! I...
# bolt
v
Hi, the Bolt team (hope someone will be there)! I have two issues, I wanted to consult on: • When I’m running any command like
bolt command run 'pwd' --user root --targets all
command runs success but it produce following messages:
Copy code
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
  Error: The current working directory doesn't exist, cannot proceed.
• I have a macOS machine with Puppet installed on it. The machine has two users: root and admin. I have a bunch of modules and the main
site.pp
to manage the machine environment: homebrew, rbenv, xcode, etc. Before, I used the
puppet apply /etc/puppetlabs/code/environments/production/manifests/site.pp
command to apply my manifest from the ssh connection as the root user. Everything working as a charm here. But my next step is to manage configuration remotely by using Bolt. I moved everything from
/etc/puppetlabs/code/environments/production
to the Bolt project. By using
bolt apply manifests/site.pp --targets all -user root
almost all catalogues are applying correctly, except the part which manages homebrew packages. That code is a custom provider from the thekevjames-homebrew module. It uses
execute
from a specific user to execute commands like
/opt/homebrew/bin/brew list --versions git-lfs
. And if executed from Bolt this command produces empty output and fails, as any other of the commands performed by another user. The
bolt command run '/opt/puppetlabs/bin/puppet apply /etc/puppetlabs/code/environments/production/manifests/site.pp' --user root --targets all
produce the same issue, which is absent if running throw ssh and puppet apply. Maybe those two issues are connected, maybe not.