Dan Pasacrita
2014-Apr-25 14:22 UTC
[Puppet Users] Any way to have puppet notify me if any files are missing from a directory?
Hey everyone, first I want to say that I joined this community a few days ago and already you guys have been amazingly helpful. One thing that's been puzzling me lately is how I can have puppet examine a directory, compare its contents against a source, but only notify you if anything is missing. I know I can have it automatically sync the contents with the following: file { '/path/to/file': ensure => "directory", recurse => "remote", mode => 755, source => "/path/to/source", } But is there any way for it to *just* check the directory, and not move anything over? Maybe it can run an exec command if it doesn't find every file that it needs to? One thing I was looking at was the creates parameter, like this: exec { "/bin/echo absent >> /home/dpasacrita/absent.txt ": creates => "/home/user_name/test_dir", } which will create a text file if the directory "test_dir" is absent. This works, but it can't check the contents, since there's no source to compare them to. So I don't think that's the right way to go about it. Any ideas? -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/7d2d3710-f2b6-41b2-88c5-dbeb53fff820%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.