PUPPET-AGENT(8)

πŸ’– PUPPET-AGENT πŸ’–

okay bestie, welcome to puppet-agent β€” the manual page for the puppet agent daemon. yes it's a whole thing, yes it's iconic, let's go. πŸŽ€


✨ NAME ✨

puppet-agent β€” the puppet agent daemon πŸ‘‘


🌸 SYNOPSIS 🌸

It grabs your client config from the Puppet master and slaps it onto the local host. literally its whole job.

This service can be run as a daemon, run periodically using cron (or something similar), or run interactively for testing purposes. three vibes, pick your fighter. πŸ’…


πŸ¦‹ USAGE πŸ¦‹

here's the whole shape of it, no cap:

puppet agent [--certname NAME] [-D|--daemonize|--no-daemonize]
[-d|--debug] [--detailed-exitcodes] [--digest DIGEST] [--disable
[MESSAGE]] [--enable] [--fingerprint] [-h|--help] [-l|--logdest
syslog|eventlog|ABS FILEPATH|console] [--serverport PORT] [--noop]
[-o|--onetime] [--sourceaddress IP_ADDRESS] [-t|--test] [-v|--verbose]
[-V|--version] [-w|--waitforcert SECONDS]

🌈 DESCRIPTION 🌈

This is the main puppet client. Its job? Retrieve the local machine's configuration from a remote server and apply it. that's the mission, that's the assignment, that's the main character energy. ✨

So here's the tea πŸ“ β€” in order to successfully communicate with the remote server, the client must have a certificate signed by a certificate authority that the server trusts. The recommended method for this, at the moment, is to run a certificate authority as part of the puppet server (which is the default, iykyk). The client will connect and request a signed certificate, and it will keep connecting until it receives one. it's giving devoted. it's giving "not leaving until you text back". 😭

Once the client has a signed certificate, it will retrieve its configuration and apply it. periodt. πŸ’…


πŸ‘‘ USAGE NOTES πŸ‘‘

puppet agent does its best to find a compromise between interactive use and daemon use. like, it's a people pleaser, we love that for it. 🫢

If you run it with no arguments and no configuration, it goes into the background, attempts to get a signed certificate, and retrieves and applies its configuration every 30 minutes. set it and forget it, bestie. ⭐

Some flags are meant specifically for interactive use β€” in particular, test, tags and fingerprint are useful. those are your little testing besties. πŸ’œ

--test runs once in the foreground with verbose logging, then exits. It also exits if it can't get a valid catalog. --test includes the --detailed-exitcodes option by default and exits with one of the following exit codes:

  • 0: The run succeeded with no changes or failures; the system was already in the desired state. ✨ (already perfect, nothing to do)
  • 1: The run failed, or wasn't attempted due to another run already in progress. πŸ’€
  • 2: The run succeeded, and some resources were changed. πŸ”₯
  • 4: The run succeeded, and some resources failed. 😭
  • 6: The run succeeded, and included both changes and failures. πŸ™ˆ

--tags allows you to specify what portions of a configuration you want to apply. Puppet elements are tagged with all of the class or definition names that contain them, and you can use the tags flag to specify one of these names, causing only configuration elements contained within that class or definition to be applied. This is very useful when you are testing new configurations β€” for instance, if you are just starting to manage ntpd, you would put all of the new elements into an ntpd class, and call puppet with --tags ntpd, which would only apply that small portion of the configuration during your testing, rather than applying the whole thing. like, test a lil bite before you eat the whole cake. πŸŽ€

--fingerprint is a one-time flag. In this mode puppet agent runs once and displays on the console (and in the log) the current certificate (or certificate request) fingerprint. Providing the --digest option allows you to use a different digest algorithm to generate the fingerprint. The main use is to verify that before signing a certificate request on the master, the certificate request the master received is the same as the one the client sent β€” to prevent against man-in-the-middle attacks when signing certificates. so basically, check the ID before you let anyone in the club. πŸ‘‘

--skip_tags is a flag used to filter resources. If this is set, then only resources not tagged with the specified tags will be applied. Values must be comma-separated. yes, comma-separated, do not fight the comma. 🌸


okay that's part 1 bestie, keep reading, we're not done yet πŸ’…

✨ OPTIONS ✨

okay bestie, first things first πŸ’– any Puppet setting that's valid in the configuration file is ALSO a valid long argument. like, server is a valid setting, so you can absolutely just say --server servername and it works. and booleans?? they get the special --no- prefix treatment to flip them off, so --setting and --no-setting are a little matched pair β€” think --daemonize and --no-daemonize 🫢

want the full list of acceptable settings? it lives in the config file docs at https://puppet.com/docs/puppet/latest/configuration.html πŸ“– and you can also get a commented list of ALL of them by running puppet agent with --genconfig. so helpful of it honestly.


  • --certname β€” sets the certname (the unique ID) of the client. the master reads this unique identifying string β€” usually the node's fully-qualified domain name β€” to figure out which configurations the node is gonna receive. use it to debug setup problems or to implement ✨unusual✨ node identification schemes. (This is a Puppet setting, and can go in puppet.conf.)
  • --daemonize β€” sends the process into the background. this is the default, bestie. (This is a Puppet setting, and can go in puppet.conf. Note the special no- prefix for boolean settings on the command line.)
  • --no-daemonize β€” does NOT send the process into the background. (This is a Puppet setting, and can go in puppet.conf. Note the special no- prefix for boolean settings on the command line.)
  • --debug β€” enable full debugging. we love full debugging πŸ’…
  • --detailed-exitcodes β€” gives you extra info about the run via exit codes; only works if --test or --onetime is also specified. if enabled, puppet agent uses these exit codes:

0: the run succeeded with no changes or failures; the system was already in the desired state. βœ…

1: the run failed, or wasn't attempted due to another run already in progress. πŸ’€

2: the run succeeded, and some resources were changed. ✨

4: the run succeeded, and some resources failed. 😭

6: the run succeeded, and included both changes and failures. πŸŽ€

  • --digest β€” change the certificate fingerprinting digest algorithm. the default is SHA256. valid values depend on the version of OpenSSL you've got installed, but they'll likely contain MD5, MD2, SHA1 and SHA256.
  • --disable β€” disables working on the local system. this puts a lock file in place, causing puppet agent to not work on the system until that lock file is removed. super useful if you're testing a configuration and you don't want the central config overriding your local state before everything is tested and committed πŸ‘‘

disable can also take an optional message that puppet agent will report at the next disabled run.

puppet agent uses the same lock file while it is running, so no more than one puppet agent process is working at a time. one at a time, no chaos, we stay organized πŸ™ˆ

puppet agent exits after executing this.
  • --enable β€” enables working on the local system. this removes any lock file, causing puppet agent to start managing the local system again. HOWEVER β€” it continues to use its normal scheduling, so it might not start for another half hour ⏰ (patience, bestie)
puppet agent exits after executing this.
  • --evaltrace β€” logs each resource as it's being evaluated. this lets you interactively see exactly what is being done. (This is a Puppet setting, and can go in puppet.conf. Note the special no- prefix for boolean settings on the command line.)
  • --fingerprint β€” displays the current certificate or certificate signing request fingerprint, then exits. use the --digest option to change which digest algorithm gets used.
  • --help β€” print this help message 🫢
  • --job-id β€” attaches the specified job id to the catalog request and the report used for this agent run. this option only works when --onetime is used. and if you're on Puppet Enterprise, do NOT use this flag β€” the orchestrator sets the job-id for you and it must be unique. so like, hands off that one πŸ”₯
  • --logdest β€” where to send log messages. choose between syslog (the POSIX syslog service), eventlog (the Windows Event Log), console, or the path to a log file. if debugging or verbosity is enabled, this defaults to console. otherwise it defaults to syslog on POSIX systems and eventlog on Windows. you can set multiple destinations with a comma separated list (eg: /path/file1,console,/path/file2)

a path ending with .json will receive structured output in JSON format. the log file will not have an ending ] automatically written to it, due to the appending nature of logging β€” it must be appended manually to make the content valid JSON. don't forget, or it's not valid, fr fr.

a path ending with .jsonl will receive structured output in JSON Lines format.

  • --masterport β€” the port on which to contact the Puppet Server. (This is a Puppet setting, and can go in puppet.conf. Deprecated in favor of the serverport setting.) so like, it still exists but it's giving legacy energy
  • --noop β€” use noop mode where the daemon runs in a no-op / dry-run mode. this is perfect for seeing what changes Puppet WOULD make without actually executing them. window shopping for config changes, we love to see it πŸ›οΈ (This is a Puppet setting, and can go in puppet.conf. Note the special no- prefix for boolean settings on the command line.)
  • --onetime β€” run the configuration once. runs a single (normally daemonized) Puppet run. useful for interactively running puppet agent when used in conjunction with the --no-daemonize option. (This is a Puppet setting, and can go in puppet.conf. Note the special no- prefix for boolean settings on the command line.)
  • --serverport β€” the port on which to contact the Puppet Server. (This is a Puppet setting, and can go in puppet.conf.)
  • --sourceaddress β€” set the source IP address for transactions. this defaults to automatically selected. (This is a Puppet setting, and can go in puppet.conf.)
  • --test β€” enable the most common options used for testing. those are onetime, verbose, no-daemonize, no-usecacheonfailure, detailed-exitcodes, no-splay, and show_diff. a whole little bundle, iconic πŸŽ€
  • --trace β€” prints stack traces on some errors. (This is a Puppet setting, and can go in puppet.conf. Note the special no- prefix for boolean settings on the command line.)
  • --verbose β€” turn on verbose reporting. give me ALL the details πŸ’œ
  • --version β€” print the puppet version number and exit.
  • --waitforcert β€” this option only matters for daemons that don't yet have certificates, and it's enabled by default, with a value of 120 (seconds). this causes puppet agent to connect to the server every 2 minutes and ask it to sign a certificate request. super useful for the initial setup of a puppet client. you can turn off waiting for certificates by specifying a time of 0. (This is a Puppet setting, and can go in puppet.conf.)
  • --write_catalog_summary β€” after compiling the catalog, saves the resource list and classes list to the node in the state directory, named classes.txt and resources.txt. (This is a Puppet setting, and can go in puppet.conf.)

🌈 EXAMPLE 🌈

look at her go:

$ puppet agent --server puppet.domain.com

πŸ¦‹ DIAGNOSTICS πŸ¦‹

Puppet agent accepts the following signals (yes she speaks signal, multilingual queen):

  • SIGHUP β€” restart the puppet agent daemon.
  • SIGINT and SIGTERM β€” shut down the puppet agent daemon.
  • SIGUSR1 β€” immediately retrieve and apply configurations from the puppet master.
  • SIGUSR2 β€” close file descriptors for log files and reopen them. used with logrotate.

πŸ‘‘ AUTHOR πŸ‘‘

Luke Kanies


Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License


okay that's the whole page bestie, you made it πŸ’– this lil masterpiece came from Puppet, Inc., dated September 2024, and it's filed under PUPPET-AGENT(8) β€” go forth and configure, you absolute main character 🫢✨

πŸ“¦ where this page comes from