This message was deleted.
# bolt
s
This message was deleted.
βœ… 1
s
I think it creates a
bolt-debug.log
file which may have more details (even with default logging).
k
@smortex Yes, I also looked into the file. But it contains nothing more than what bolt prints to console.
s
OK. Maybe try something like
bolt command run -t TARGET "id"
to check that you connect where you think and as the user you think (no
--run-as root
in your example, usually Puppet needs to be root to manage the system). Other than
id
you can try
env
,
facter
,
which puppet
to see if it finds the tooling. I remember some issues depending on the env of the remote user, and sudo can also be tuned to change the environment, e.g. providing a custom
$PATH
.
also
bolt task run puppet_agent::install -t TARGET
called directly may give more details maybe?
k
@smortex Thanks. There seems to be no problem with the connection to the target host and remote user(root)'s env:
Copy code
$ bolt command run -t TARGET "id" 
uid=0(root) gid=0(root) groups=0(root)

$ bolt command run -t TARGET "which puppet" 
/usr/bin/puppet

$ bolt command run -t TARGET "facter"
(JSON printed)
... but this command did not work:
Copy code
$ bolt task run puppet_agent::install -t TARGET

Could not find a task named 'puppet_agent::install'. For a list of available tasks, run 'bolt task show'.
I remembered that I installed the bolt using
gem install bolt
into my own interpreter env
/opt/rbenv/versions/3.2.2
. Do I need to install any dependent gems that provides
puppet_agent::install
task?
y
I guess you miss some modules bundled with bolt then
πŸ’― 1
k
@Yury Bushmelev That's it!! πŸ‘ πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰
Copy code
$ vi bolt-project.yaml

# added lines
modules:
  - puppetlabs-service
  - puppetlabs-puppet_agent
  - puppetlabs-facts
Copy code
$ bolt task run puppet_agent::install -t TARGET
(snip)
Started on TARGET...
Finished on TARGET:
  17:02:32 +0900 INFO: Version parameter not defined and agent detected. Nothing to do.
@Yury Bushmelev @smortex Thank you a lot for all your help.πŸ™
πŸ‘πŸ» 1
While I can go further with bolt now, I wonder if bolt could log the fact that it failed to load these modules... a detailed log is so helpful for tool newbies.πŸ™
y
Usually it’s expected that ppl use the puppet distribution packages which has everything bundled
But better diagnostic is always good
πŸ‘ 1
b
yeah, is there a reason you installed it as gem?
k
@bastelfreak I am using bolt on macOS and familier to develop in Ruby. So
gem install
was easier and quicker way for me than macOS package or
brew cask
. I also assumed that bolt would work faster on Ruby 3.2 than the bundled Ruby 2.7. I had to pay more attention to the words "with all of its dependencies" in the warning messageπŸ˜…
Bolt might be installed as a gem. To use Bolt reliably and with all of its dependencies, uninstall the 'bolt' gem and install Bolt as a package
b
yep πŸ™‚ In general you can install it as gem, I do that from time to time, but it's not supported and you need to take care of all module dependencies
πŸ‘ 1