We’ve provided several CLI commands to help with debugging and
exploring Puppet Server. Most of the commands are the same ones you would use
in a Ruby environment — such as gem, ruby, and irb — except they run
against Puppet Server’s JRuby installation and gems instead of your system Ruby.

Note that if you are running from source, you need to separate flag arguments (such as --version or -e) with --, as shown above. Otherwise, those arguments will be applied to Leiningen instead of to Puppet Server. This isn’t necessary when running from
packages (i.e., puppetserver <subcommand>).

gem

Installs and manages gems that are isolated from system Ruby and are accessible only to Puppet Server. This is a simple wrapper around the standard Ruby gem, so all of the
usual arguments and flags should work as expected.

If needed, you also can use the JAVA_ARGS_CLI environment variable to pass
along custom arguments to the Java process that the gem command is run within.

Example:

$ JAVA_ARGS_CLI=-Xmx8g puppetserver gem install pry --no-ri --no-rdoc

If you prefer to have the JAVA_ARGS_CLI option persist for multiple command
executions, you could set the value in the /etc/sysconfig/puppetserver or
/etc/default/puppetserver file, depending upon your OS distribution:

JAVA_ARGS_CLI=-Xmx8g

With the value specified in the sysconfig or defaults file, subsequent commands
would use the JAVA_ARGS_CLI variable automatically:

If you prefer to have the JAVA_ARGS_CLI option persist for multiple command
executions, you could set the value in the /etc/sysconfig/puppetserver or
/etc/default/puppetserver file, depending upon your OS distribution:

JAVA_ARGS_CLI=-Xmx8g

With the value specified in the sysconfig or defaults file, subsequent commands
would use the JAVA_ARGS_CLI variable automatically:

If needed, you also can use the JAVA_ARGS_CLI environment variable to pass
along custom arguments to the Java process that the irb command is run within.

Example:

$ JAVA_ARGS_CLI=-Xmx8g puppetserver irb

If you prefer to have the JAVA_ARGS_CLI option persist for multiple command
executions, you could set the value in the /etc/sysconfig/puppetserver or
/etc/default/puppetserver file, depending upon your OS distribution:

JAVA_ARGS_CLI=-Xmx8g

With the value specified in the sysconfig or defaults file, subsequent commands
would use the JAVA_ARGS_CLI variable automatically:

$ puppetserver irb
// Would run 'irb' with a maximum Java heap of 8g

foreground

Starts the Puppet Server, but doesn’t background it; similar to starting the service
and then tailing the log.

Accepts an optional --debug argument to raise the logging level to DEBUG.