{"id":457,"date":"2009-07-30T17:51:47","date_gmt":"2009-07-30T16:51:47","guid":{"rendered":"http:\/\/wp.devco.net\/?p=457"},"modified":"2009-10-09T13:57:33","modified_gmt":"2009-10-09T12:57:33","slug":"what_does_puppet_manage_on_a_node","status":"publish","type":"post","link":"https:\/\/www.devco.net\/archives\/2009\/07\/30\/what_does_puppet_manage_on_a_node.php","title":{"rendered":"What does puppet manage on a node?"},"content":{"rendered":"

Sometimes it’s nice to try and figure out what resources of a machine are being managed by puppet.  Puppet keeps a state file in either YAML or Marshall format called localconfig.yaml<\/i> it’s full of useful information, I wrote a quick script to parse it and show you what’s being managed.<\/p>\n

Typical output is:<\/p>\n

Classes included on this node:
        nephilim.ml.org
        common::linux
        <snip><\/p>\n

Resources managed by puppet on this node:
        service{smokeping: }
                defined in common\/modules\/smokeping\/manifests\/service.pp:6<\/p>\n

        file{\/etc\/cron.d\/mrtg: }
                defined in common\/modules\/puppet\/manifests\/init.pp:201
<snip><\/p><\/blockquote>\n

It will show all classes and all resources including where in your manifests the resource comes from.  Unfortunately for resources created by defines it shows the define as the source but I guess you can’t have it all.<\/p>\n

You can get the code here<\/a> it’s pretty simple, just pass it a path to your localconfig.yaml file, it supports both YAML and Marshal formats.<\/p>\n

The file also has every property of the resources in it etc, so you can easily extend this to print a lot of other information, just use something like pp<\/i> to dump out the contents of Puppet::TransObject<\/i> objects to see what’s possible.<\/p>\n","protected":false},"excerpt":{"rendered":"

Sometimes it’s nice to try and figure out what resources of a machine are being managed by puppet.  Puppet keeps a state file in either YAML or Marshall format called localconfig.yaml it’s full of useful information, I wrote a quick script to parse it and show you what’s being managed. Typical output is: Classes included […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","footnotes":""},"categories":[7],"tags":[121,21,13,33],"_links":{"self":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/457"}],"collection":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/comments?post=457"}],"version-history":[{"count":2,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/457\/revisions"}],"predecessor-version":[{"id":510,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/posts\/457\/revisions\/510"}],"wp:attachment":[{"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/media?parent=457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/categories?post=457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devco.net\/wp-json\/wp\/v2\/tags?post=457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}