... | ... | @@ -566,6 +566,44 @@ field in `hiera/common.yaml`. |
|
|
You also need to add them to the `adm` group in LDAP, see [adding
|
|
|
users to a group in LDAP](howto/ldap#adding-removing-users-in-a-group).
|
|
|
|
|
|
## Examining a Puppet catalog
|
|
|
|
|
|
It can sometimes be useful to examine a node's catalog in order to
|
|
|
determine if certain resources are present, or to view a resource's
|
|
|
full set of parameters.
|
|
|
|
|
|
### List resources by type
|
|
|
|
|
|
To list all `service` resources managed by Puppet on a node, the
|
|
|
command below may be executed on the node itself:
|
|
|
|
|
|
puppet catalog select --terminus rest "$(hostname -f)" service
|
|
|
|
|
|
At the end of the command line, `service` may be replaced by any
|
|
|
built-in resource types such as `file` or `cron`. Defined resource
|
|
|
names may also be used here, like `ssl::service`.
|
|
|
|
|
|
### View/filter full catalog
|
|
|
|
|
|
To extract a node's full catalog in JSON format:
|
|
|
|
|
|
puppet catalog find --terminus rest "$(hostname -f)"
|
|
|
|
|
|
The output can be manipulated using `jq` to extract more precise
|
|
|
information. For example, to list all resources of a specific type:
|
|
|
|
|
|
jq '.resources[] | select(.type == "File") | .title' < catalog.json
|
|
|
|
|
|
To list all classes in the catalog:
|
|
|
|
|
|
jq '.resources[] | select(.type=="Class") | .title' < catalog.json
|
|
|
|
|
|
To display a specific resource selected by title:
|
|
|
|
|
|
jq '.resources[] | select((.type == "File") and (.title=="sources.list.d"))' < catalog.json
|
|
|
|
|
|
More examples can be found on this [blog post](http://web.archive.org/web/20210122003128/https://alexharv074.github.io/puppet/2017/11/30/jq-commands-for-puppet-catalogs.html).OB
|
|
|
|
|
|
## Troubleshooting
|
|
|
|
|
|
### Running Puppet by hand and logging
|
... | ... | |