PUPPET-DEVICE(8)

okay bestie, we're doing the puppet-device(8) page from the Puppet manual and honestly? it's giving "quietly runs your entire remote device fleet" energy and nobody talks about it. sit down, grab a strawberry drink πŸ“, and let's go through it together, no cap.


✨ NAME ✨

puppet-device β€” manage remote network devices πŸ’…


🌈 SYNOPSIS 🌈

Retrieves catalogs from the Puppet master and applies them to remote
devices.

This subcommand can be run manually; or periodically using cron, a
scheduled task, or a similar tool.

fr fr, you can just run it by hand, or let cron (or a scheduled task, or literally any tool that does the same job) poke it on a timer. both are valid. main character energy either way πŸ‘‘


πŸ“± USAGE πŸ“±

puppet device [-h|--help] [-v|--verbose] [-d|--debug] [-l|--logdest
syslog|file|console] [--detailed-exitcodes] [--deviceconfig file]
[-w|--waitforcert seconds] [--libdir directory] [-a|--apply file]
[-f|--facts] [-r|--resource type [name]] [-t|--target device]
[--user=user] [-V|--version]

that's the whole shape of it, bestie. every flag down there has a whole personality, we'll get to them 🌸


πŸ’– DESCRIPTION πŸ’–

here's the thing: devices can't just vibe on their own. they need a proxy Puppet agent to do the heavy lifting β€” that agent requests certificates, collects facts, retrieves and applies catalogs, and stores reports. the device just sits there looking cute while the agent does everything. iconic division of labor tbh 🫢


πŸŽ€ USAGE NOTES πŸŽ€

so, devices that get managed by the puppet-device subcommand on a Puppet agent? they're configured in device.conf, which lives at $confdir/device.conf by default, and you can change that with the $deviceconfig setting. slay.

the device.conf file is an INI-like file, with one section per device:

[DEVICE_CERTNAME] type TYPE url URL debug

the section name is literally the certname of the device. that's its whole identity. the values for the type and url properties are specific to each type of device β€” so don't go guessing, okay?

the optional debug property specifies transport-level debugging, and it's limited to telnet and ssh transports. that's it, those two, periodt.

for details, go read https://puppet.com/docs/puppet/latest/config_file_device.html β€” it's all there, iykyk.


πŸ‘‘ OPTIONS πŸ‘‘

quick heads up before the list: any setting that's valid in the configuration file is also a valid long argument. for example, server is a valid configuration parameter, so you can totally specify --server servername as an argument. cute, right? ✨

  • --help, -h β€” print this help message. the classic. the GOAT πŸ™Œ
  • --verbose, -v β€” turn on verbose reporting. she talks more. we love that for her.
  • --debug, -d β€” enable full debugging. maximum yapping, all the details πŸ”
  • --logdest, -l β€” where to send log messages. choose between syslog (the POSIX syslog service), console, or the path to a log file. if debugging or verbosity is enabled, this defaults to console. otherwise, it defaults to syslog. you can set multiple destinations using a comma separated list (eg: /path/file1,console,/path/file2). a path ending with .json will receive structured output in JSON format. but β€” and this is the annoying part 😭 β€” the log file will not have an ending ] automatically written to it, because logging just keeps appending. you have to append it manually to make the content valid JSON. rude, but that's the deal.
  • --detailed-exitcodes β€” provide transaction information via exit codes. if this is enabled, an exit code of 1 means at least one device had a compile failure, an exit code of 2 means at least one device had resource changes, and an exit code of 4 means at least one device had resource failures. exit codes of 3, 5, 6, or 7 mean that a bitwise combination of the preceding exit codes happened. yes bestie, it's a bitmask, do the math πŸ’€
  • --deviceconfig β€” path to the device config file for puppet device. default: $confdir/device.conf
  • --waitforcert, -w β€” this one only matters for targets that don't have certificates yet, and it's enabled by default with a value of 120 (seconds). it makes puppet device poll the server every 2 minutes and ask it to sign a certificate request. super useful for the initial setup of a target. you can turn off waiting for certificates by specifying a time of 0.
  • --libdir β€” override the per-device libdir with a local directory. specifying a libdir also disables pluginsync. useful for testing. a path ending with .jsonl will receive structured output in JSON Lines format.
  • --apply β€” apply a manifest against a remote target. target must be specified. (not optional, bestie, she will not guess πŸ™ˆ)
  • --facts β€” displays the facts of a remote target. target must be specified.
  • --resource β€” displays a resource state as Puppet code, roughly equivalent to puppet resource. can be filtered by title. requires --target be specified.
  • --target β€” target a specific device/certificate in the device.conf. doing so will perform a device run against only that device/certificate. one device, one vibe, no distractions πŸ’…
  • --to_yaml β€” output found resources in yaml format, suitable to use with Hiera and create_resources.
  • --user β€” the user to run as.

🌸 EXAMPLE 🌸

$ puppet device --target remotehost --verbose

look at her go πŸ¦‹


πŸ¦‹ AUTHOR πŸ¦‹

Brice Figureau β€” thank you for your service, king πŸ‘‘


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


and that's the whole page, bestie πŸ’– it's the puppet-device(8) manual from Puppet, Inc., dated September 2024, and you read the entire thing, which means you're officially smarter than everyone in the group chat. go apply a catalog to a remote device and be the main character you were born to be πŸŒˆπŸ‘‘βœ¨

πŸ“¦ where this page comes from