PUPPET-RESOURCE(8)
π PUPPET-RESOURCE(8) π
okay bestie, so this is puppet-resource from the Puppet manual β it's the resource abstraction layer shell and honestly? it's iconic. it's giving "let me just peek directly at your system and turn it into Puppet code". sit down, grab a boba, we're doing this π§β¨
πΈ NAME πΈ
puppet-resource β the resource abstraction layer shell π
β¨ SYNOPSIS β¨
Uses the Puppet RAL to directly interact with the system. no cap, that's literally it π«Ά
π USAGE π
puppet resource [-h|--help] [-d|--debug] [-v|--verbose] [-e|--edit]
[-p|--param parameter] [-t|--types] [-y|--to_yaml] type [name]
[attribute=value ...]
π¦ DESCRIPTION π¦
okay so this command is lowkey a whole vibe: it gives you simple facilities for converting your current system state into Puppet code, plus some ability to modify the current state using Puppet's RAL. it's giving main character energy π₯
by default, bestie, you gotta at least give it a type to list β and then puppet resource will tell you everything it knows about all resources of that type. so nosy. so thorough. we love her π
you can optionally specify an instance name too, and then puppet resource will only describe that single instance. one (1) resource. no extras. periodt.
and if you give it a type, a name, AND a series of attribute=value pairs, puppet resource will modify the state of the specified resource. alternatively β if you give it a type, a name, and the --edit flag β it'll write its output to a file, open that file in an editor, and then apply the saved file as a Puppet transaction. slay π
π OPTIONS π
ngl, a little heads up first: any setting that's valid in the configuration file is also a valid long argument. for example, ssldir is a valid setting, so you can specify --ssldir directory as an argument. iykyk β¨
see the configuration file documentation at https://puppet.com/docs/puppet/latest/configuration.html for the full list of acceptable parameters. and a commented list of all configuration options can also be generated by running puppet with --genconfig. obsessed with that tbh πΈ
--debugβ Enable full debugging. go off, show us everything π--editβ Write the results of the query to a file, open the file in an editor, and read the file back in as an executable Puppet manifest. it's giving "collab with your editor" βοΈ--helpβ Print this help message. classic, iconic, never misses π--paramβ Add more parameters to be outputted from queries. more data, more better π--typesβ List all available types. the whole menu, bestie π--verboseβ Print extra information. chatty era π£οΈ--to_yamlβ Output found resources in yaml format, suitable to use with Hiera andcreate_resources. yaml girlies rise π§--failβ Fails and returns an exit code of1if the resource could not be modified. dramatic? yes. useful? also yes π
β EXAMPLE β
this example uses puppet resource to return a Puppet configuration for the user luke:
$ puppet resource user luke
user { Β΄lukeΒ΄:
home => Β΄/home/lukeΒ΄,
uid => Β΄100Β΄,
ensure => Β΄presentΒ΄,
comment => Β΄Luke Kanies,,,Β΄,
gid => Β΄1000Β΄,
shell => Β΄/bin/bashΒ΄,
groups => [Β΄sysadminΒ΄,Β΄audioΒ΄,Β΄videoΒ΄,Β΄puppetΒ΄]
}
look at that output. clean. structured. ate and left no crumbs π
π AUTHOR π
Luke Kanies π
π COPYRIGHT π
Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License π
okay that's the whole page, bestie!! this was brought to you by Puppet, Inc., dated September 2024 β mwah, go forth and inspect your resources πβ¨π¦
π¦ where this page comes from
- arch rolling: puppet 8.10.0-6 Β· Apache-2.0
- fedora 43: puppet 8.10.0-2.fc43 Β· Apache-2.0
- fedora 43: puppet 8.10.0-3.fc43 Β· Apache-2.0
- fedora 44: puppet 8.10.0-4.fc44 Β· Apache-2.0
- fedora 44: puppet 8.10.0-5.fc44 Β· Apache-2.0
- nixos 26.05: puppet 8.10.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms