Ask Your Question
0

Get in puppet what is monitored by puppet

asked 2015-01-07 10:04:03 -0500

Lewandowski gravatar image

Hey @all,

we are happy to use puppet with a big surprise every day ;). Each a new challenge.
Now to the Problem:

We've got a module for haproxy with configurations what takes place with puppet. Now we want another configuration for haproxy. So far we don't have problems. But in some cases we need only the first configuration, in other only the second.

What we need is a possibility to check, which files are monitored by puppet. Example:

Node 1 -> haproxy -> Monitored by Puppet with a special configuration
Node 2 -> haproxy -> Not monitored

Now we have to detect if the file is monitored. I know it is possible with

cat $(puppet agent --configprint resourcefile) | grep haproxy

on the node itself.

Is there any way to do it with a module inside puppet or is a request on the node the only way to get this information?

Thanks Sascha

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-01-07 15:18:50 -0500

cbarbour gravatar image

Puppet's reporting and inventory engine is a typical way to check what resources are being managed by puppet from a central location. Using a console such as Puppet Enterprise or Foreman will allow you to inspect what is being managed on each node. PuppetDB will also provide a centralized inventory, and is useful if you want to write an external application to inspect state.

You can also audit un-managed resources. In this case, Puppet will report the state of the resource and notify you when the resource changes, but it will not enforce any state on the resource. See the audit metaparameter for more details.

edit flag offensive delete link more

Comments

Thx cbarbour, I will take a look on it and audit sounds very useful for this. Saw it on PuppetLabs KB but don't connect it in this case. I will head back if i need further information. Sascha

Lewandowski gravatar imageLewandowski ( 2015-01-08 07:40:32 -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

1 follower

Stats

Asked: 2015-01-07 10:04:03 -0500

Seen: 448 times

Last updated: Jan 07 '15