Editing settings on the command line

Puppet loads most of its settings from the puppet.conf config file. You can edit this file directly, or you can change individual settings with the puppet config set command.

Use puppet config set for:

  • Fast one-off config changes,

  • Scriptable config changes in provisioning tools,

If you find yourself changing many settings, edit the puppet.conf file instead, or manage it with a template.

Usage

To assign a new value to a setting, run:
sudo puppet config set <SETTING NAME> <VALUE> --section <CONFIG SECTION>

This declaratively sets the value of <SETTING NAME> to <VALUE> in the specified config section, regardless of whether the setting already had a value.

Config sections

The --section option specifies which section of puppet.conf to modify. It is optional, and defaults to main. Valid sections are:

  • main (default) — used by all commands and services

  • server — used by the primary Puppet server service and the puppetserver ca command

  • agent — used by the Puppet agent service

  • user — used by the puppet apply command and most other commands

When modifying the system config file, use sudo or run the command as root or Administrator.

Example

Consider the following puppet.conf file:
[main]
certname = agent01.example.com
server = server.example.com
vardir = /var/opt/lib/pe-puppet

[agent]
report = true
graph = true
pluginsync = true

[server]
dns_alt_names = server,server.example.com,puppet,puppet.example.com
If you run the following commands:
sudo puppet config set reports puppetdb --section server
sudo puppet config set ordering manifest
The puppet.conf file now looks like this:
[main]
certname = agent01.example.com
server = server.example.com
vardir = /var/opt/lib/pe-puppet
ordering = manifest

[agent]
report = true
graph = true
pluginsync = true

[server]
dns_alt_names = server,server.example.com,server,server.example.com
reports = puppetdb