Ask Your Question
1

How to view compiled catalog

asked 2014-11-28 21:27:22 -0500

GeneBean gravatar image

updated 2014-11-29 08:13:49 -0500

I want to view the compiled catalog for a host that includes everything that would be applied in some easy to read format... is there a way to do this? I have not seen such a thing in Foreman, Puppet Board, or Puppet Explorer, which I find a little odd. I am running PuppetDB too in case it makes a difference. Thanks!

Edit per answer from Jonn I must be missing something as the puppet catalog command isn't telling me anything either:

[genebean@puppet ~]$ sudo puppet catalog find puppet.example.edu --render-as dot
Notice: Compiled catalog for puppet.example.edu in environment production in 0.07 seconds
digraph Puppet__Resource__Catalog {
    label = "Puppet__Resource__Catalog"
    "Class[Settings]" [
        fontsize = 8,
        label = "Class[Settings]"
    ]

    "Class[main]" [
        fontsize = 8,
        label = "Class[main]"
    ]

    "Stage[main]" [
        fontsize = 8,
        label = "Stage[main]"
    ]

    "Stage[main]" -> "Class[Settings]" [
        fontsize = 8
    ]

    "Stage[main]" -> "Class[main]" [
        fontsize = 8
    ]

}
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-11-29 04:51:39 -0500

jonn gravatar image

updated 2014-11-29 04:54:07 -0500

You can use puppet catalog find <node> to obtain a node's catalog.

You can also pass a --render-as parameter to specify an output format. If you choose --render-as dot, you'll get some output in DOT format that can be run through Graphviz to obtain a graphical representation of the catalog, which is probably the most readable option.

More info is available here.

edit flag offensive delete link more

Comments

I edited the original question but still need some help please. Thanks!

GeneBean gravatar imageGeneBean ( 2014-11-29 08:14:22 -0500 )edit

Hi - I think that is probably the output when the catalog is compiled locally. You might need to add `--terminus rest` to get it to talk to the puppetmaster - that way, you'll get to see any classes added by the ENC/console.

jonn gravatar imagejonn ( 2014-11-29 09:59:29 -0500 )edit

The terminus flag was what was needed, thanks!

GeneBean gravatar imageGeneBean ( 2014-11-30 08:17:07 -0500 )edit

As a followup, I posted a new question about viewing via the web at http://ask.puppetlabs.com/question/14805/web-viewer-for-puppet-catalogs/

GeneBean gravatar imageGeneBean ( 2014-11-30 12:59:44 -0500 )edit

For me 'puppet catalog' takes 30 seconds. Before I knew about 'puppet catalog' I wrote a quick Ruby hack which reads the cached catalog on a host. It takes less than a second: https://gist.github.com/happymcplaksin/8e262e98db6bd28d0ce9

Mark Plaksin gravatar imageMark Plaksin ( 2014-12-01 10:04:20 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2014-11-28 21:27:22 -0500

Seen: 889 times

Last updated: Nov 29 '14