Ask Your Question
2

puppet subscribe to a file that it doesn't manage

asked 2013-05-29 13:57:15 -0500

inthedark gravatar image

updated 2013-05-29 14:51:56 -0500

llowder gravatar image

Can I have Puppet subscribe to a file that it doesn't manage, but it does manage the parent directory?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2013-05-29 14:51:20 -0500

llowder gravatar image

No, Puppet cannot send notifications based on resources it does not manage.

In the case of a file resource, it can appear to - in the case where you have a managed directory and "recurse => true". In this case, Puppet crates an implicit file resource.

It is also not possible to have subscription noticed fired of when something outside of Puppet changes a file (only when Puppet changes it back to the described state)

edit flag offensive delete link more
1

answered 2013-05-30 07:10:16 -0500

jgoldschrafe gravatar image

updated 2013-05-30 07:12:13 -0500

Like llowder said, Puppet is explicitly designed not to work this way. It only cares (and knows about) about resources you explicitly tell it to care about and manage.

I'm not sure what problem you're exactly trying to solve, but I was curious if Puppet could be abused to do this without any external tools. I don't recommend actually doing what I'm proposing, but it was a fun thought experiment.

  1. Create a custom fact that produces a checksum for the directory in question. You'll need to sort all the filenames deterministically, concatenate the output together ...
(more)
edit flag offensive delete link more

Comments

Hi, Actually I am looking to subscribe to a file that Puppet manages through "recurse => true". So it appears that this is possible. Thanks

inthedark gravatar imageinthedark ( 2013-05-30 12:41:13 -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

Stats

Asked: 2013-05-29 13:57:15 -0500

Seen: 210 times

Last updated: May 30 '13