Configure Puppet Server
If needed, you can configure Puppet Server settings to optimize your Puppet Enterprise (PE) installation.
Set the Ruby load path
The ruby_load_path
setting determines where Puppet Server finds components
such as Puppet and Facter.
$puppetserver_jruby_puppet_ruby_load_path = [ \
'/opt/puppetlabs/puppet/lib/ruby/vendor_ruby', \
'/opt/puppetlabs/puppet/cache/lib']
libdir
you must also change the vardir
.You can change the load path array in pe.conf
.
Enable JRuby multithreading
The jruby_puppet_multithreaded
setting enables multithreaded mode,
which uses a single JRuby instance to process requests (such
as catalog compiles) concurrently.
By default, multithreading is disabled (set to false
).
You can use Hiera to toggle multithreaded mode.
Use cached data when updating classes
The environment_class_cache_enabled
setting specifies whether
cached data is used when updating classes in the Puppet Enterprise (PE) console. When true
, Puppet Server uses file sync when refreshing classes, which
provides improved performance.
The default value for
environment_class_cache_enabled
depends on whether
you use Code Manager:
- Without Code Manager, the default value is
false
(disabled). - With Code Manager, the default value is
true
(enabled).
environment_class_cache_enabled
to true
, you must make sure your chosen code
deployment method (such as r10k) clears the
environment cache when it completes code deployments. If the environment
cache isn't cleared, the Node Classifier service doesn't receive new class
information until the Puppet Server service is
restarted.You can use Hiera to
toggle the environment_class_cache_enabled
setting.
Change the environment_timeout
setting
The environment_timeout
setting controls if and how long the primary
server caches environment data. Environment caching can reduce your Puppet Server's CPU usage, but longer cache times extend the amount
of time it takes for environments to reflect changes to their Puppet code.
environment_timeout
parameter accepts these
values: - No caching:
0
- Retain environment data caches indefinitely:
unlimited
- Cache environments for a specified length of time after their last use: Any
length of time, such as
5m
By default, environment_timeout
is set to 0
. When
you Enable Code Manager, environment_timeout
is set to 5m
.
However, if you set code_manager_auto_configure
to true
in your Code Manager settings, then
environment_timeout
is automatically set to
unlimited
.
environment_timeout
to 0
taxes your primary server's performance but makes it
easy for new users to deploy updated Puppet code.
Once your code deployment process is mature (or after enabling Code Manager), we recommend changing this setting to
unlimited
.Refer to the Puppet documentation for more information About environments, including Environment limitations, such as leakage and resource conflicts.
The following steps explain how to change the environment_timeout
setting in pe.conf
. You can also change this setting in the PE console in the PE Master
node group. For instructions on changing settings in the console, refer to Configure settings in the PE console.
Populate the puppet-admin
certificate allowlist
Use pe.conf
to add trusted certificates to the
puppet-admin
certificate allowlist.
Disable software update monitoring
The Puppet Server (pe-puppetserver
) service checks for updates when it starts, restarts, and
every 24 hours while running. You can disable these automatic software update
checks.
pe-puppetserver
service sends the following basic, anonymous information to our servers at Puppet by Perforce:- Product name
- Puppet Server version
- IP address
- Data collection timestamp
You can turn off automatic software update monitoring in the Puppet Enterprise (PE) console.
Puppet Server configuration files
At startup, Puppet Server reads all .conf
files in the conf.d
directory, which is located at
/etc/puppetlabs/puppetserver/conf.d
.
The conf.d
directory contains these files:
File name | Description |
---|---|
auth.conf |
Contains authentication rules and settings for agents and API
endpoint access. You can learn more about auth.conf in the Puppet documentation. |
global.conf |
Contains global configuration settings for Puppet Server, including logging
settings. You can learn more about global.conf in the Puppet documentation. |
metrics.conf |
Contains settings for Puppet Server
metrics services. You can learn more about metrics.conf in the Puppet documentation. |
pe-puppet-server.conf |
Contains Puppet Server settings specific
to Puppet Enterprise. Refer to pe-puppet-server.conf settings for details about each setting. |
webserver.conf |
Contains SSL service configuration settings. You can learn more about webserver.conf in the Puppet documentation. |
ca.conf |
Deprecated. Contained rules for Certificate Authority
services, but has been superseded by webserver.conf
and auth.conf . |
Additional files, such as code-manager.conf
might
exist depending on how you use PE.
pe-puppet-server.conf
settings
The pe-puppet-server.conf
file contains Puppet Server settings specific to Puppet Enterprise. All the settings are wrapped in a
jruby-puppet
section.
-
enable-file-sync-locking
orfile_sync::file_sync_locking_enabled
- Controls whether the file sync client locks the JRuby pool (and, by extension, most requests to Puppet Server) while deploying Puppet code.
gem-home
- Determines where JRuby looks for gems. This
is also used by the
puppetserver gem
command line tool. jruby_max_active_instances
- Controls the maximum number of JRuby instances to allow on the Puppet Server.
max_requests_per_instance
- Sets the maximum number of requests allowed for each JRuby interpretor instance before it is killed.
max-queued-requests
- Sets the maximum number of requests allowed to be queued waiting to borrow from the JRuby pool.
max-retry-delay
- Sets the maximum number of seconds allowed for the random sleep time set
when the
max-queued-requests
limit is exceeded. The random sleep time is returned as aRetry-After
header on the 503 response for each rejected request. -
pre-commit-hook-commands
orpuppetserver::pre_commit_hook_commands
- Specify scripts, as an array of strings, that you want the file sync storage server to execute against a repo after receiving a change but before committing and syncing the change across compilers. This is similar to Configuring post-deployment commands for r10k or Configuring post-environment hooks for Code Manager.
puppet-code-repo
- Identifies, as a string, the internal name for the Puppet code repo (the codedir) that contains all code to sync across compilers (including user-supplied code repos).
-
ruby-load-path
orpuppetserver_jruby_puppet_ruby_load_path
- Determines where Puppet Server finds components
such as Puppet and Facter. The agent's
libdir
path is included by default. server-conf-dir
- Sets the Puppet configuration directory path.
server-var-dir
- Sets the Puppet Server variable directory path.