Troubleshooting puppet infrastructure run commands
If puppet infrastructure run commands fail, review the
logs at /var/log/puppetlabs/installer/bolt_info.log and check
for these issues.
Running commands when logged in as a non-root user
All puppet infrastructure run commands require you to act
as the root user on all nodes that the command touches. If you are trying to run a puppet infrastructure run command as a non-root user, you must be
able to SSH into the impacted nodes (as the same non-root user) in order for the command to
succeed.
When you run a
puppet infrastructure run command, Bolt uses your system's existing OpenSSH ssh_config configuration file to connect to your nodes. If this file is missing
or misconfigured, Bolt tries to connect as root. To make sure
the correct user connects to the nodes, you have the following options:- Set up your OpenSSH
ssh_configconfiguration file to point to a user withsudoprivileges. For example:Host *.example.net UserKnownHostsFile=~/.ssh/known_hosts User <USER_WITH_SUDO_PRIVILEGES> - When running a
puppet infrastructure runcommand, include the--user <USER_WITH_SUDO_PRIVILEGES>flag.
If your
sudo configuration requires a password to run
commands, include the --sudo-password <PASSWORD> flag
when running a puppet infrastructure run command.
Tip: To avoid logging the password to
.bash_history,
set HISTCONTROL=ignorespace in your .bashrc file, and add a space to the beginning of the command.If your operating system distribution includes the
requiretty option in the /etc/sudoers file, you
must do one of the following:- Remove this option from the file.
- Include the
--ttyflag when running apuppet infrastructure runcommand.
Passing hashes from the command line
When passing a hash on the command line as part of a
puppet
infrastructure run command, the hash must be wrapped in quotes, much like a JSON
object. For
example:'{"parameter_one": "value_one", “parameter_two”: “value_two”}'