Puppet settings are highly dynamic, and their values can come from several different places.
To see the actual settings values that a Puppet service will use, it’s often best to ask Puppet itself. The
puppet config print command lets you do this.
puppet config print command loads and evaluates settings, and can imitate any of Puppet’s other commands and services when doing so. The
--environment options let you control how settings are loaded; for details, see the sections below on imitating different services.
Note: To ensure that you’re seeing the values Puppet will use when running as a service, be sure to use
sudoor run the command as
Administrator. If you run
puppet config printas some other user, Puppet might not use the system config file.
$ sudo puppet config print <SETTING NAME> [--section <CONFIG SECTION>] [--environment <ENVIRONMENT>]
This will show just the value of
$ sudo puppet config print <SETTING 1> <SETTING 2> [...] [--section <CONFIG SECTION>] [--environment <ENVIRONMENT>]
This will show
name = value pairs for all requested settings.
$ sudo puppet config print [--section <CONFIG SECTION>] [--environment <ENVIRONMENT>]
This will show
name = value pairs for all settings.
--section option specifies which section of puppet.conf to use when finding settings. It is optional, and defaults to
main. Valid sections are:
main(default) — used by all commands and services
master— used by the Puppet master service and the
agent— used by the Puppet agent service
user— used by the Puppet apply command and most other commands
As usual, the other sections will override the
main section if they contain a setting; if they don’t, the value from
main will be used, or a default value if the setting isn’t present there.
--environment option specifies which environment to use when finding settings. It is optional and defaults to the value of the
environment setting in the
user section (usually
production, since it’s rare to specify an environment in
Note that you can only specify environments that already exist.
This option is generally only useful when looking up settings used by the Puppet master service, since it’s rare to use environment config sections for Puppet apply and Puppet agent.
To see the settings the Puppet master service and the Puppet cert command would use:
--environmentoption to specify the environment you want settings for, or let it default to
config.rufile to make sure it’s using the confdir and vardir that you expect. If it’s using non-standard ones, you will need to specify them on the command line with the
--vardiroptions; otherwise you might not see the correct values for settings.
To see the effective modulepath used in the
$ sudo puppet config print modulepath --section master --environment dev /etc/puppetlabs/code/environments/dev/modules:/etc/puppetlabs/code/modules:/opt/puppetlabs/puppet/modules
To see whether PuppetDB is configured for exported resources:
$ sudo puppet config print storeconfigs storeconfigs_backend --section master storeconfigs = true storeconfigs_backend = puppetdb
To see the settings the Puppet agent service would use:
To see whether the agent is configured to use manifest ordering when applying the catalog:
$ sudo puppet config print ordering --section agent manifest
To see the settings the Puppet apply command would use:
To see whether Puppet apply is configured to use reports:
$ sudo puppet config print report reports --section user report = true reports = store,http