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 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
Any valid environment can be specified, including environments that don’t exist or don’t have any settings configured.
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 may 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/puppet/environments/dev/modules:/etc/puppetlabs/puppet/modules:/opt/puppet/share/puppet/modules
To see whether the
$trusted variables are enabled:
$ sudo puppet config print trusted_node_data immutable_node_data --section master trusted_node_data = true immutable_node_data = true
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
Prior to Puppet 3.5 and Puppet Enterprise 3.2, the
puppet config print command wasn’t flexible enough to imitate all of Puppet’s applications and services. Instead, you would need to use one of the following commands:
puppet master --configprint <SETTING>
puppet agent --configprint <SETTING>
puppet apply --configprint <SETTING>
These behave much the same as the current behavior of
puppet config print, and still work with this version of Puppet.